0

I am updating code that someone else wrote, in order to be drive independent. I am taking data from an access database and doing a mailmerge to word. The real problem is When the word template document is opened, it begins the attempt to mailmerge, but it gives me an error since the drive is assigned statically rather than by a network share.

What I need to do is reassign the mail merge to use a drive share, instead of a letter. I am sort of unfamiliar with word. There are no events (I thought it might be under document open firing) in visual basic, So it must be some setting in word. As well, since it fires on document opening, I assume that as well must be a setting. Thanks for any advice.

Jason Bayldon
  • 1,296
  • 6
  • 24
  • 41
  • It is nearly always best to output a text file from MS Access and to use that for your mailmerge. See http://stackoverflow.com/questions/13171891/access-word-2010-vba-mail-merge-tries-to-open-foldername-mdb-instead-of-accd – Fionnuala Jan 08 '13 at 18:09
  • thanks for the reply. What I am wondering as well though, is how does the mail merge event fire if there is nothing in Visual Basic? – Jason Bayldon Jan 08 '13 at 18:14
  • There are events, they are just harder to get hold of http://msdn.microsoft.com/en-us/library/office/aa140279(v=office.10).aspx – Fionnuala Jan 08 '13 at 18:19
  • @remou Yes, forgive me if i am being naive, I understand but there are no events at all, no modules, nothing under thisdocument, and nothing I can find. That link supposes there is code written under the thisdocument event. So where do you look for say a document open or mail merge event? Is it possible that code exists, runs, then is being removed from the document? I dont think there is a way to create a break point as i open? – Jason Bayldon Jan 08 '13 at 18:31
  • 1
    Sorry, I was rushing. There is no code to drive a mailmerge event, the template itself contains all the information required. I thought you wished to create code to capture the open event, say, and change the mailmerge details. I am not sure where you are starting and where you wish to end up. I would start in MS Access and build everything required, except perhaps the template, and that I would launch from Access with automation. – Fionnuala Jan 08 '13 at 19:16

0 Answers0