Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / February 2007

Tip: Looking for answers? Try searching our database.

Outlook Email Merge with Attachment

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ann Campbell - 23 Feb 2007 16:56 GMT
I am sending out five mass emailings to clients.  I'm able to setup
the email merge and message in HTML format for the body of the email;
however, I need specific pdfs to attach to the mass mailing.

This is the code that I have so far and when it runs successfuly on
the email merge template (and any email window that is open); however,
when I click email merge as the final step, the emails go out without
attachments.  I've tried to save the emails in the Outbox, open the
emails and run the macro there, but the files attach to only one
email.

Sub AttachPDF()
Dim objItem
On Error Resume Next
Set objItem = Application.ActiveInspector.CurrentItem
objItem.Attachments.Add "K:\filepath\filename1.pdf"
objItem.Attachments.Add "K:\filepath\filename2.pdf"
objItem.Attachments.Add "K:\filepath\filename3.pdf"
objItem.Attachments.Add "K:\filepath\filename4.pdf"
objItem.Attachments.Add "K:\filepath\filename5.pdf"
Set objItem = Nothing
End Sub

I know very little about macros and VB in Outlook, so your patience
and guidance is greatly appreciated!!

Thanks,
Ann
Michael Bauer [MVP - Outlook] - 26 Feb 2007 06:08 GMT
Ann, probably you have to call objItem.Save in the end.

Signature

Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
 Keep your Outlook categories organized!
 http://www.shareit.com/product.html?productid=300120654&languageid=1
 (German: http://www.VBOffice.net/product.html?pub=6)

Am 23 Feb 2007 08:56:12 -0800 schrieb Ann Campbell:

> I am sending out five mass emailings to clients.  I'm able to setup
> the email merge and message in HTML format for the body of the email;
[quoted text clipped - 24 lines]
> Thanks,
> Ann
Ann Campbell - 26 Feb 2007 21:15 GMT
On Feb 26, 1:08 am, "Michael Bauer [MVP - Outlook]" <m...@mvps.org>
wrote:
> Ann, probably you have to call objItem.Save in the end.
>
[quoted text clipped - 35 lines]
> > Thanks,
> > Ann

I changed Nothing to Save and ran the macro on the email merge.  The
files attached to the merge template email; however, when the merge
completed, the sent emails did not have the attached files.
Michael Bauer [MVP - Outlook] - 27 Feb 2007 06:27 GMT
Please show what you've changed exactly.

Signature

Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
 Keep your Outlook categories organized!
 http://www.shareit.com/product.html?productid=300120654&languageid=1
 (German: http://www.VBOffice.net/product.html?pub=6)

Am 26 Feb 2007 13:15:28 -0800 schrieb Ann Campbell:

> On Feb 26, 1:08 am, "Michael Bauer [MVP - Outlook]" <m...@mvps.org>
> wrote:
[quoted text clipped - 41 lines]
> files attached to the merge template email; however, when the merge
> completed, the sent emails did not have the attached files.
Ann Campbell - 27 Feb 2007 15:14 GMT
On Feb 27, 1:27 am, "Michael Bauer [MVP - Outlook]" <m...@mvps.org>
wrote:
> Please show what you've changed exactly.
>
[quoted text clipped - 52 lines]
> > files attached to the merge template email; however, when the merge
> > completed, the sent emails did not have the attached files.

Sub AttachPDF()
Dim objItem
On Error Resume Next
Set objItem = Application.ActiveInspector.CurrentItem
objItem.Attachments.Add "K:\filepath\filename1.pdf"
objItem.Attachments.Add "K:\filepath\filename2.pdf"
objItem.Attachments.Add "K:\filepath\filename3.pdf"
objItem.Attachments.Add "K:\filepath\filename4.pdf"
objItem.Attachments.Add "K:\filepath\filename5.pdf"
Set objItem = Save
End Sub
Michael Bauer [MVP - Outlook] - 28 Feb 2007 06:08 GMT
Ok, I thought that :-)  As mentioned, please write:
objItem.Save.

Signature

Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
 Keep your Outlook categories organized!
 http://www.shareit.com/product.html?productid=300120654&languageid=1
 (German: http://www.VBOffice.net/product.html?pub=6)

Am 27 Feb 2007 07:14:33 -0800 schrieb Ann Campbell:

> On Feb 27, 1:27 am, "Michael Bauer [MVP - Outlook]" <m...@mvps.org>
> wrote:
[quoted text clipped - 66 lines]
> Set objItem = Save
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.