Results 1 to 2 of 2
2006-02-09, 13:53 #1
- Join Date
- Jun 2004
- Thanked 0 Times in 0 Posts
Access Merge Letters in Microsoft Word 2003 (2003 SP2)
I have a query in Access which looks to the details currently showing on the form that the user has open (name and address details). This query is linked to a Word document. The Word document picks up the data from the query (normal DDE link), thus displaying the address of the record the user is looking at in Access (because the Mailmerge Toolbar option for View Merged Data is on). It works beautifully on all but 1 PC.
On the PC it doesn't work on (which has the same version of Access, Word, etc as the 5 other that do work, and the same service packs) it keeps displaying the details of an older record (i.e. one viewed when the document was first viewed today) and only refreshes to the current record when you click into the document. The obvious setting change that could have made all of the difference is Word/Tools/Options/General/Update Automatic Links @ Open - which is ticked on.
I have spent hours looking at different scenario's. The most irritating thing is that if you open the document by double-clicking on it it works fine - but when you open the document from within Access it doesn't (without clicking in the document itself).
The code within Access (in case this rings alarm bells with anyone) that calls the Word Document is:
Dim objWord As Word.Document
Set objWord = GetObject(DocName, "Word.Document")
objWord.Application.Visible = True
(where DocName is the variable containing the full path to the letter).
Any help/guidance would be appreicated.
2006-02-09, 14:42 #2
- Join Date
- Mar 2002
- Thanked 28 Times in 28 Posts
Re: Access Merge Letters in Microsoft Word 2003 (2003 SP2)
I can't explain why it doesn't work on one PC.
I usually store the Word document without data source (ActiveDocument.MailMerge.MainDocumentType = wdNotAMergeDocument), and create it on the fly using Automation. See <post:=263,603>post 263,603</post:> and <post:=375,939>post 375,939</post:> for examples. This approach is very flexible, and has been working well in many databases for over 6 years now.