Opening a merged Word document.

J

Josh

If I want to open a specific Word document/file, I use
this function in my VB Code:

Private Sub openDoc(docName As String)

Dim objWord As Object, objDoc As Object

Set objWord = CreateObject("Word.Application")

On Error GoTo Err_openDoc

Set objDoc = objWord.Documents.Open("I:\SOP
Dunwin\Forms\" + _
docName)

'objDoc.Visible = True

objWord.Visible = True

Set objWord = Nothing
Set objDoc = Nothing

Exit_openDoc:
Exit Sub

Err_openDoc:
MsgBox Err.Description
Resume Exit_openDoc

End Sub

This works great. You guys helped me out with this and I
am very appreciative.

However, if this word document is merged with a query (one
where there is user input), is there any extra code I have
to use, such as an update member function? I ask this
because when I open the merged word document using this
code, I am asked to enter a value, but the word document
doesn't update properly. (I can open it up manually from
Word and it works all the time, so I am certain it is
something wrong with the code).

I was just wondering if there is any special code that I
need to put into my form that allows the merged file to
update correctly.

Thanks in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top