I am trying to create an email routine, depending on user preference, sendsA = automatically
C = opens memo in compose mode
I can get it to work but would like to know the correct way of doing this.
I get " you must specify parent document" error if I code this way:
Set mailDb = New NotesDatabase(“”,“”)
If iSendOption = “A” Then
Set EmailDoc = mailDb.CreateDocument
Elseif iSendOption = “B” Then
Call mailDb.OpenMail
Set EmailDoc = mailDb.CreateDocument
End If
’ Error occurs here:
Set rtBodyitem = New NotesRichTextItem(Emaildoc, “Body”)
The problem goes away if I do:
If iSendOption = “A” Then
Set mailDb = New NotesDatabase(“”,“”)
Set EmailDoc = mailDb.CreateDocument
Elseif iSendOption = “B” Then
Set mailDb = New NotesDatabase(“”,“”)
Call mailDb.OpenMail
Set EmailDoc = mailDb.CreateDocument
End If
Set rtBodyitem = New NotesRichTextItem(Emaildoc, “Body”)
Syntatically, is the first way incorrect?
JJ