I am using the following VBA code to open a Word (2000 SP3) document from an Excel-based macro. After the document is open, I need to:
1) answer yes/no to a pop-up question from Word asking if I want to update the Links in the Word document
2) answer disable/enable to the pop-up question from Word asking if I want to enable/disable Macros in the document (I digitally sign the macros eventually, so this isn't a long-term problem, but it's a pain to sign the macros during development and if there's an easy way to say "yes" to the pop-up question then I'd like to know how)
3) MOST IMPORTANT!!!: once the Word document is really active, I need to fire off a couple of VBA macros that I've written and which reside in the word document.
I'm about to start looking at how to move the Word macros over to my Excel VBA project ... but I'd really rather leave them in the word document and fire them off from my "calling macro."
Any ideas / help would be appreciated.
-----------------
Dim wdApp As Word.Application, wdDoc As Word.Document
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then 'Word isn't already running
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
Set wdDoc = wdApp.Documents.Open _
("C:\Data\Contract.doc")
wdApp.Visible = True
1) answer yes/no to a pop-up question from Word asking if I want to update the Links in the Word document
2) answer disable/enable to the pop-up question from Word asking if I want to enable/disable Macros in the document (I digitally sign the macros eventually, so this isn't a long-term problem, but it's a pain to sign the macros during development and if there's an easy way to say "yes" to the pop-up question then I'd like to know how)
3) MOST IMPORTANT!!!: once the Word document is really active, I need to fire off a couple of VBA macros that I've written and which reside in the word document.
I'm about to start looking at how to move the Word macros over to my Excel VBA project ... but I'd really rather leave them in the word document and fire them off from my "calling macro."
Any ideas / help would be appreciated.
-----------------
Dim wdApp As Word.Application, wdDoc As Word.Document
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err.Number <> 0 Then 'Word isn't already running
Set wdApp = CreateObject("Word.Application")
End If
On Error GoTo 0
Set wdDoc = wdApp.Documents.Open _
("C:\Data\Contract.doc")
wdApp.Visible = True