Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Placing "Signature"

Status
Not open for further replies.

rmabwing5

Technical User
Feb 24, 2011
1
US
I am creating a new Lotus Notes email using MS Access and VBA.
I have the following code:

Private Sub cmdEmail_Click()
Dim Notes As Object
Dim Maildb As Object
Dim objNotesDocument As Object
Dim objNotesField As Object
Dim Subject As String
Dim Attachment As String
Dim RecipientIS As String
Dim RecipientFS As String
Dim Sender As String
Dim BodyText As String
Dim InitialPath As String
Dim strFileName As String
Dim Workspace As Object
Dim Signature As String

Set Notes = CreateObject("Notes.NotesSession")
Set Maildb = Notes.GETDATABASE("", "")

Maildb.OPENMAIL

Subject = "Subject of email"

Select Case cboInsideSales.Value
Selects an inside sales rep. (removed due to company security)
End Select
'
Select Case cboAppEng.Value
Selects an applications engineer. (removed due to company security)
End Select
'
Select Case cboFieldSales.Value
Selects an field sales rep. (removed due to company security)
End Select

Set objNotesDocument = Maildb.CreateDocument
Set objNotesField = objNotesDocument.AppendItemValue("Subject", Subject)
Set objNotesField = objNotesDocument.AppendItemValue("SendTo", RecipientIS)
Set objNotesField = objNotesDocument.AppendItemValue("CopyTo", RecipientFS)
Set objNotesField = objNotesDocument.AppendItemValue("BlindCopyTo", Sender)
Set objNotesField = objNotesDocument.CreateRichTextItem("Body")

InitialPath = This selects the directory of a document for attachment

strFileName = This selects the document

BodyText = vbCrLf & vbCrLf & "Please find the following attachment." & vbCrLf & vbCrLf & _
"========================= Company Name ============================" & vbCrLf & _
This is a company disclosure (May not stay this way)"=============================================================================="

Attachment = InitialPath & strFileName

objNotesField = objNotesField.EMBEDOBJECT(1454, "", Attachment)

Call objNotesField.AppendText(BodyText)

Call objNotesDocument.ReplaceItemValue("Body", BodyText)

Set Workspace = CreateObject("Notes.NotesUIWorkspace")

Call Workspace.EDITDOCUMENT(True, objNotesDocument)

AppActivate "Lotus Notes"

End Sub

If the signature is automatically placed into the memo, as text, the Body text appends to the last line of it.

I want the Text I put into the email to go before the signature, the attachment to go directly after the Text and THEN the signature after the attachment. The company disclosure should come after the signature.

Can anyone enlighten me on this issue?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top