View Single Post
Old 05-24-2012, 03:22 AM
Baldeagle Baldeagle is offline Windows XP Office 2007
Advanced Beginner
Join Date: Apr 2012
Posts: 61
Baldeagle is on a distinguished road

Thanks for pointing me to the MVP document. I am working through this but am having a bit of a struggle!
I have created a Directory document called Test Email Mailmerge.docx (see attached). This is linked to my source data (which is a query in MS Access). Attachment1 is a Word document (created as an email) which is also linked to the same data source. Attachment2 is also a Word document (created as a Form for completion by the recipient) and is also linked to the same data source.
My intention had been that I wanted Attachment1 to be emailed to those in my data source with Attachment2 attached to that email.
But by following the MVP document I have a couple of problems -
1. In the example, it shows that when the Directory is merged Attachment1 & Attachment2 are showing information related to the person in the relevant email address. How does that happen if the path is simply to a file? Even though that file is a mailmerge document? My attachments are simply showing the path to the main mailmerge documents.
2. What file are you supposed to attach the VB macro to? Is it to the original Directory document, or to the document created by merging the Directory document or to the first of my attachments?
3. When I did get the macro to run it came up with 2 errors. At both
Dim oOutlookApp As Outlook.Application and Dim oItem As Outlook.MailItem
it says there is a 'Compile Error - User Defined type not defined'. I tried by eliminating both these lines but, although the macro seemed to run (it asked me for a title for the email) at the end it said no emails had been sent (when there should have been 3). I am not proficient in VB so I am struggling here.

Can you please help me a bit more on the above? Should I be using my Attachment1 as the main email or am I right to have both my files as attachments?
I look forward to hearing from you again.
Reply With Quote