View Single Post
  #4  
Old August 16th 06, 09:20 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Sample Code for Merge With Attachments?

On the surface, it says that there's no Tables(1) in the MailList document. You can use the Locals window to check the Tables collection.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"LongWayFromHome" wrote in message ...
Sue, this is a big leap forward for me on this project. Thank you!

The macro I took from the MVP site seems to work with one exception. When I
step through, this line is dysfunctional:

While Counter = Maillist.Tables(1).Rows.Count

When I test Maillist... in the Immediate window, I get "The requested member
of the collection does not exist."

What am I missing?
--
Dave


"Sue Mosher [MVP-Outlook]" wrote:

See http://word.mvps.org/faqs/mailmerge/...ntscontent.htm for one approach. If you put the code in Outlook's VBA environment (Alt+F11, just like in Access) and derive all Outlook objects from the intrinsic Application object, you won't get security prompts.


"LongWayFromHome" wrote in message ...
I code VBA in Access (intermediate level) and have been going nuts trying to
send emails with PDF attachments to selected recipients. Apparently this can
be done from inside Access, but after weeks of struggle with the appropriate
libraries -- but little helpful advice from experts -- I am giving up. The
PDF creation is a piece of cake. The record selection is easy. The failure
occurs in trying to drive Outlook from within Access.

So, I would like to run an email merge from within Word or Outlook and use
VBA to attach the PDF file. I know how to do a merge using macros but I
don't know how to write the VBA code or where to put it. If someone out
there can show me some sample code and maybe provide a little guidance, I am
sure I can make this work...finally!

Thanks!
--
Dave


Ads