I am creating a memo in the UI in the current user’s mail file. I am building the text, populating the Body field, and then importing the signature as an .html file.
However, when I attempt to call the Import method, it throws the “Document command is not available” error.
Here is the code:
'Open Memo for user in user's mailbox...
'First, turn off signature...
Set docMailProfile = dbMail.GetProfileDocument("CalendarProfile")
strProfileEnableSignature = docMailProfile.EnableSignature(0)
If strProfileEnableSignature = "1" Then
docMailProfile.EnableSignature = ""
Call docMailProfile.Save(True, False)
End If
'Create the memo...
Set docEmail = dbMail.CreateDocument
docEmail.Form = "Memo"
Call docEmail.ComputeWithForm(False, False)
'Need to remove the Body, then add the text, then add a signature if there is one...
Call docEmail.RemoveItem("Body")
Set emailBody = docEmail.CreateRichTextItem("Body")
'......building the body here......
'Show the memo...
Call docEmail.ComputeWithForm(False, False)
Set docUIMemo = w.EditDocument(True, docEmail)
'Add the signature...
sigOption = docMailProfile.SignatureOption(0)
Select Case sigOption
Case "1"
Call docUIMemo.FieldAppendText("Body", docMailProfile.Signature_1(0))
Case "2"
sigFilePath = docMailProfile.Signature_2(0)
sigExtension = Right(sigFilePath, Len(sigFilePath) - Instr(sigFilePath, "."))
Select Case sigExtension
Case "jpeg", "jpg":
sigFileFilter = "JPEG Image"
Case "gif":
sigFileFilter = "GIF Image"
Case "bmp":
sigFileFilter = "BMP Image"
Case "htm", "html":
sigFileFilter ="HTML File"
Case "txt":
sigFileFilter ="ASCII Text"
End Select
Call docUIMemo.Import(sigFileFilter,sigFilePath) <---------- ERROR HITS HERE
End Select
'Turn signature back on...
If strProfileEnableSignature = "1" Then
docMailProfile.EnableSignature = "1"
Call docMailProfile.Save(True, False)
End If
Call docUIMemo.Reload
The docUIMemo is in Edit Mode (set to True) when I debug.
I use this code, without any changes, in the Notes 7.0.3 client/Designer, and it works fine. I copied into the 8.5 client/designer and it is throwing this error.
I searched Notes 6/7 forum, but did not find a solution:
Any help would be appreciated.
Thanks!
Dan