|
|
Question : Outlook Macro to Attach File
|
|
How do I write an Outlook macro that will attach a file, write some specified text in the body and subject line of the email and send it to specified users?
|
Answer : Outlook Macro to Attach File
|
|
Hi newbie,
Sub newbie() With Application.CreateItem(olMailItem) .Attachments.Add "C:\specific file.zip" .Subject = "Your subject" .To = "[email protected];user[email protected]om" .Recipients.ResolveAll .Body = "Some specified text" & vbCrLf & vbCrLf & "With a blank line in between" 'or, to send an HTML formatted message, remove the .body line and replace with: '.HTMLBody = "Some specified text
With a blank line in between" .Send 'or, to just show it on screen forcing the user to send it.. '.Display End With End Sub
Matt
|
|
|
|
|