I have used the code below before, works fine. But I have two questions:
1) In the line starting "Set EmbedObj = AttachME.EMBEDOBJECT(.......", what exactly is the 1454 and is there ever anything that could be populated in the item after 1454? Each time I've see this code it's always "...(1454,"",....).
2) Is it possible to rename the attachment you are passing without creating a new file. In otherwords, the example below the attachment being pulled in is name '1.pdf', but when I send the email I want the file name to be xyz.pdf. Is this possible?
Set nosession = CreateObject("Notes.NotesSession")
Set noDatabase = nosession.GETDATABASE("", "")
If noDatabase.IsOpen = False Then noDatabase.OPENMAIL
Set noDocument = noDatabase.CreateDocument
With noDocument
.Form = "Memo"
.SendTo = "xxx@xxx.com"
.Subject = "Test Subject"
.SaveMessageOnSend = True
.PostedDate = Now()
Set AttachME = .CREATERICHTEXTITEM("Attachment")
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", 1.pdf, "Attachment")
.Send 0
End With
Set nosession = Nothing
Set noDatabase = Nothing
Set noDocument = Nothing
Set EmbedObj = Nothing
Set AttachME = Nothing
1) In the line starting "Set EmbedObj = AttachME.EMBEDOBJECT(.......", what exactly is the 1454 and is there ever anything that could be populated in the item after 1454? Each time I've see this code it's always "...(1454,"",....).
2) Is it possible to rename the attachment you are passing without creating a new file. In otherwords, the example below the attachment being pulled in is name '1.pdf', but when I send the email I want the file name to be xyz.pdf. Is this possible?
Set nosession = CreateObject("Notes.NotesSession")
Set noDatabase = nosession.GETDATABASE("", "")
If noDatabase.IsOpen = False Then noDatabase.OPENMAIL
Set noDocument = noDatabase.CreateDocument
With noDocument
.Form = "Memo"
.SendTo = "xxx@xxx.com"
.Subject = "Test Subject"
.SaveMessageOnSend = True
.PostedDate = Now()
Set AttachME = .CREATERICHTEXTITEM("Attachment")
Set EmbedObj = AttachME.EMBEDOBJECT(1454, "", 1.pdf, "Attachment")
.Send 0
End With
Set nosession = Nothing
Set noDatabase = Nothing
Set noDocument = Nothing
Set EmbedObj = Nothing
Set AttachME = Nothing