This is related to Excel VBA only because I run everything from an Excel
front-end...
Does anyone know if there is an object in the Outlook object model that
would allow me to use the contents of a text file or word doc as the
body of an e-mail by reference.
My code is below...
Sub Email()
Dim SafeItem As Object, oItem As Object
Dim OLF As Outlook.MAPIFolder
Set SafeItem = CreateObject("Redemption.SafeMailItem")
Set OLF = GetObject("", _
"Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(olFolderInb
ox)
Set oItem = OLF.Items.Add
With oItem
.Subject = SubjectLine
.Body = Body
.Attachments.Add Attachment, olByValue, , "Attachment"
.OriginatorDeliveryReportRequested = False
.ReadReceiptRequested = True
End With
SafeItem.Item = oItem
SafeItem.Recipients.Add recipient1
SafeItem.Recipients.ResolveAll
SafeItem.Send
End Sub
The object above requires a string, which I can do, but life would be so
much easier if I could just tell it to grab the contents of a file.