R
Randy
I can start Word ok, just cannot get a blank document to come up, so when my
script runs it gets an error because it expects a blank Doc to be up.
Here is what I am doing -
Dim WordApplication As Object
Dim WordApp As Object
' Add four additional steps for initialization and post processing
OpenCancelDialog "Opening Microsoft Word", ReportOptions.TotalClasses + 4
StepCancelDialog "Opening Microsoft Word", 0
'GSB Fix exception error handling
' If an error occurs then go to the TryWord95Create label
' On Error GoTo TryWord95Create XXX revalid
' Create an instance of Word using Word 97 technique
Set WordApplication = CreateObject ("Word.Application")
Set WordApp = WordApplication.WordBasic
GoTo HaveWordApp
TryWord95Create:
'GSB Fix exception error handling
' If an error occurs then go to the CancelPressed label
' On Error GoTo CancelPressed XXX revalid
' Create an instance of Word using Word 95 technique
Set WordApp = CreateObject ("Word.Basic")
HaveWordApp:
' If an error occurs then go to the CancelPressed label
' On Error GoTo CancelPressed XXX revalid
StepCancelDialog "Loading Document Template", 1
' WordApp.FileNew TemplatePathName$
WordApp.FileNew
SubStepCancelDialog
' WordApp.FileSaveAs FileName$
script runs it gets an error because it expects a blank Doc to be up.
Here is what I am doing -
Dim WordApplication As Object
Dim WordApp As Object
' Add four additional steps for initialization and post processing
OpenCancelDialog "Opening Microsoft Word", ReportOptions.TotalClasses + 4
StepCancelDialog "Opening Microsoft Word", 0
'GSB Fix exception error handling
' If an error occurs then go to the TryWord95Create label
' On Error GoTo TryWord95Create XXX revalid
' Create an instance of Word using Word 97 technique
Set WordApplication = CreateObject ("Word.Application")
Set WordApp = WordApplication.WordBasic
GoTo HaveWordApp
TryWord95Create:
'GSB Fix exception error handling
' If an error occurs then go to the CancelPressed label
' On Error GoTo CancelPressed XXX revalid
' Create an instance of Word using Word 95 technique
Set WordApp = CreateObject ("Word.Basic")
HaveWordApp:
' If an error occurs then go to the CancelPressed label
' On Error GoTo CancelPressed XXX revalid
StepCancelDialog "Loading Document Template", 1
' WordApp.FileNew TemplatePathName$
WordApp.FileNew
SubStepCancelDialog
' WordApp.FileSaveAs FileName$