troubleshooting Question

How to open a Word doc in VBA (2)

Avatar of Clive Beaton
Clive BeatonFlag for Australia asked on
Microsoft AccessVBA
6 Comments2 Solutions240 ViewsLast Modified:
In response to my original question of the same title, hnasr gave me the following code;

    Dim objWord As Object, objDoc As Object
    'Start Word and open a new document
    Set objWord = CreateObject("Word.Application")
    objWord.Visible = True
    Set objDoc = objWord.Documents.Add
    ' existing doc
    Dim objDoc2 As Object
    Set objDoc2 = objWord.Documents.Add(ReportName)

It worked fine when applied to a standard document, but when I opened a document created in Mail Merge, it did not refresh the selected record.

Any advice?

Thanks in advance.
Join our community to see this answer!
Unlock 2 Answers and 6 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 6 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros