I'm trying to set up a small macro in word that will automatically send the documents as an attachment in an Outlook message to a named recipient in my macro. I also want to include a subject line in my macro. I know this can be done with SendMail, but I'm having difficulty setting it up. Can any give me an example to go by?
This conversation is currently closed to new comments.
You just need to fill in the blanks for subject, recipient, and attachments.
Sub CallCreateMail() ' This procedure shows how to pass an array of recipients, ' a subject line, a message body, and an array of attachments ' to the CreateMail procedure. Dim strSubject As String Dim strBody As String Dim avarRecip(2) As Variant Dim avarAttach(2) As Variant
You just need to fill in the blanks for subject, recipient, and attachments.
Sub CallCreateMail() ' This procedure shows how to pass an array of recipients, ' a subject line, a message body, and an array of attachments ' to the CreateMail procedure. Dim strSubject As String Dim strBody As String Dim avarRecip(2) As Variant Dim avarAttach(2) As Variant
Your answer made sense. However, what if the document I'm placing this macro in is the actual attachment? How do I set up my attachment array to grab that actual document. My apologies - I know very little Visual Basic!
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
A SendMail Macro in MS Word???