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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email from macro

Status
Not open for further replies.

thabrane

Programmer
Aug 20, 2003
94
US
Hello,
I am using a subroutine in a macro to automatically email an attachment to some users. I would like to copy more than one person, but am having trouble getting it to work properly. when I only copy one person, it works perfectly. I just don't know how to add the second person. Any thoughts would be great.

Thanks
 
PS
Below is the coding of my subroutine which calls Lotus Notes and creates the email with attachments





dim IngDirectory As Object
Dim IndDatabase As Object
Dim IndDocument As Object
Dim IndRTItem As Object

'Lotus assigns the integer 1454 to EMBED_ATTACHMENT
Const EMBED_ATTACHMENT = 1454

'Concatenate report path & name to form attachment
strAttachment$ = strReportPath$ & strReport1Name$ & ".pdf"

Set IngDirectory = IndSession.GetDbDirectory("")
Set IndDatabase = IngDirectory.OpenMailDatabase
Set IndDocument = IndDatabase.CreateDocument

'--Set Message Headers

Call IndDocument.AppendItemValue("Subject", strSubject$)
Call IndDocument.ReplaceItemValue("SendTo", strTo$)
Call IndDocument.ReplaceItemValue("CopyTo", strCC$)

'---Set Delivery Options

IndDocument.EncryptOnSend = False
IndDocument.SaveMessageOnSend = False
'IndDocument.ReturnReceipt = True

Call IndDocument.ReplaceItemValue("ReturnReceipt", True)

'---Add Content

Set IndRTItem = IndDocument.CreateRichTextItem("Body")
IndRTItem.AppendText(strBody$)
Set IndRTItem = Nothing

Set IndRTItem = IndDocument.CreateRichTextItem("MyRichText" & i)

'msgbox strAttachment$


call IndRTItem.EmbedObject(EMBED_ATTACHMENT, "", strAttachment$)
Set IndRTItem = Nothing

'---Send Message

call IndDocument.Send( FALSE )

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top