Good morning. I have pulled together enough code to send an e-mail with my MailMerge attachments
But I'm wondering if it's possible to change the "From:" in the message so the recipient can set up a Rule to put these messages in a particular folder in their Inbox? Or at the very least so they can differentiate these messages from any others received from me.
I've tried using
but get an error message
Many thanks,
D€$
Code:
Dim oOutlookApp As Outlook.Application
Dim oItem As Outlook.MailItem
Set oOutlookApp = GetObject(, "Outlook.Application")
With oItem
.To = "des.lavender@xyz.com"
.Subject = "Project Flag Sheet"
'Add the document as an attachment, you can use the .displayname property
'to set the description that's used in the message
.Body = "Hello. These are the Mailmerge documents." & vbCrLf & _
vbCrLf & "Best regards"
For i = 1 To UBound(MyArray)
'(Is there a better way of doing this?)
.Attachments.Add Source:=MyArray(i), Type:=olByValue, DisplayName:="Document as attachment"
Next i
.Send
End With
I've tried using
Code:
.SenderName = "TEST"
Compile error:
Can't assign to read-only property
Many thanks,
D€$