CarlStephens
Board Regular
- Joined
- Sep 25, 2020
- Messages
- 128
- Office Version
- 2016
- Platform
- Windows
Hello All,
The below code creates a new email in Lotus Notes, which is a little lengthy but works as required, however, the cursor always finishes at the bottom of the newly created email and I need to review the email from the top.....is there a code that I can add to the below that will mean the email cursor is at the top of the email? Small, I know, but there are lot of emails that I need to review, so this will save a lot of time. Thank you for your time.
Public Sub Create_and_Display_Notes_Email2()
Dim NUIWorkspace As Object
Dim NUIDocument As Object
Dim ToEmail As String, CCEmail As String, BCCEmail As String, Subject As String, BodyText As String
With ActiveSheet
ToEmail = .Range("C2").Value
CCEmail = .Range("C3").Value
BCCEmail = .Range("C4").Value
Subject = .Range("C5").Value
BodyText = Join(Application.Transpose(.Range("C7", .Cells(.Rows.Count, "C").End(xlUp)).Value), vbCrLf)
End With
Set NUIWorkspace = CreateObject("Notes.NotesUIWorkspace")
'Create an email using the Notes UI
NUIWorkspace.ComposeDocument , , "Memo"
Do
Set NUIDocument = NUIWorkspace.CurrentDocument
DoEvents
Loop While NUIDocument Is Nothing
With NUIDocument
.FieldSetText "EnterSendTo", ToEmail
.FieldSetText "EnterCopyTo", CCEmail
.FieldSetText "EnterBlindCopyTo", BCCEmail
.FieldSetText "Subject", Subject
.GoToField "Body"
.InsertText BodyText
MsgBox "Go to your emails and you will see that a email has been created with all of the details."
End With
The below code creates a new email in Lotus Notes, which is a little lengthy but works as required, however, the cursor always finishes at the bottom of the newly created email and I need to review the email from the top.....is there a code that I can add to the below that will mean the email cursor is at the top of the email? Small, I know, but there are lot of emails that I need to review, so this will save a lot of time. Thank you for your time.
Public Sub Create_and_Display_Notes_Email2()
Dim NUIWorkspace As Object
Dim NUIDocument As Object
Dim ToEmail As String, CCEmail As String, BCCEmail As String, Subject As String, BodyText As String
With ActiveSheet
ToEmail = .Range("C2").Value
CCEmail = .Range("C3").Value
BCCEmail = .Range("C4").Value
Subject = .Range("C5").Value
BodyText = Join(Application.Transpose(.Range("C7", .Cells(.Rows.Count, "C").End(xlUp)).Value), vbCrLf)
End With
Set NUIWorkspace = CreateObject("Notes.NotesUIWorkspace")
'Create an email using the Notes UI
NUIWorkspace.ComposeDocument , , "Memo"
Do
Set NUIDocument = NUIWorkspace.CurrentDocument
DoEvents
Loop While NUIDocument Is Nothing
With NUIDocument
.FieldSetText "EnterSendTo", ToEmail
.FieldSetText "EnterCopyTo", CCEmail
.FieldSetText "EnterBlindCopyTo", BCCEmail
.FieldSetText "Subject", Subject
.GoToField "Body"
.InsertText BodyText
MsgBox "Go to your emails and you will see that a email has been created with all of the details."
End With