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

Email using Notes Automation

Status
Not open for further replies.

SHardy

Programmer
May 9, 2001
231
GB
I am trying to send an email, via some code in an Excel97 file. This mail should have a file attachment. The code I am using is as follows:

Call objNotesDocument.REPLACEITEMVALUE("SendTo", arrRecipient)
Call objNotesDocument.REPLACEITEMVALUE("Subject", "Test")
Call objNotesDocument.REPLACEITEMVALUE("Body", "Test email.")
Call objNotesDocument.GETATTACHMENT("F:\test.txt")
Call objNotesDocument.SEND(False)

The email is being sent/ received ok. However, it does not have the file attachment.

Could someone please advise what I am doing wrong? And how I should be doing it?

Thanks,
S
 
Found an example that seems to work. This changes it to the following:

Attachment = "F:\test.xls"
Call objNotesDocument.REPLACEITEMVALUE("SendTo", arrRecipient)
Call objNotesDocument.REPLACEITEMVALUE("Subject", "Test")
Call objNotesDocument.REPLACEITEMVALUE("Body", "Test Email.")
Set AttachMe = objNotesDocument.CREATERICHTEXTITEM("Attachment")
Set EmbedObj = AttachMe.EMBEDOBJECT(1454, "", Attachment, "Attachment")
Call objNotesDocument.SEND(False)

A bit strange, though, telling it that I am attaching an RTF when it is an excel file...?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top