P
proashu
I am trying to invoke MS word in the following manner:
start winword.exe /lc:\glb\myglobal.dot /tc:\tmp\doctemplate.dot /
myglobal.dot -
My global template - contains the following logic
Public Sub AutoExec()
If ActiveDocument.Bookmarks.Exists("CSWB") Then If (InStr(1,
ActiveDocument.FullName, ".rtf") < 1) Then
ActiveDocument.RunAutoMacro (wdAutoNew)
End if
End If
doctemplate.dot -
A document template that contains the AutoNew macro defined.
Problem scenario:
When I run - "start winword.exe /lc:\glb\myglobal.dot
/tc:\tmp\doctemplate.dot /" from command prompt it works fine.
I install Adobe Acrobat writer on my machine, and run the same command,
It fails with a Runtime 91 error - Object variable not set
Looks like ActiveDocument object is not initialized and fails when I try to
access ActiveDocument.Bookmarks collection.
When I uninstall Adobe acrobat writer, the problem goes away.
This is happening in production as well (that actually triggered this
analysis) but I don't necessarily see Adobe writer installed in production.
Is there anything else that when installed would change the behaviour of
AutoExec as I have mentioned ?
If you have any ideas as to how can I avoid this, that would be great.
start winword.exe /lc:\glb\myglobal.dot /tc:\tmp\doctemplate.dot /
myglobal.dot -
My global template - contains the following logic
Public Sub AutoExec()
If ActiveDocument.Bookmarks.Exists("CSWB") Then If (InStr(1,
ActiveDocument.FullName, ".rtf") < 1) Then
ActiveDocument.RunAutoMacro (wdAutoNew)
End if
End If
doctemplate.dot -
A document template that contains the AutoNew macro defined.
Problem scenario:
When I run - "start winword.exe /lc:\glb\myglobal.dot
/tc:\tmp\doctemplate.dot /" from command prompt it works fine.
I install Adobe Acrobat writer on my machine, and run the same command,
It fails with a Runtime 91 error - Object variable not set
Looks like ActiveDocument object is not initialized and fails when I try to
access ActiveDocument.Bookmarks collection.
When I uninstall Adobe acrobat writer, the problem goes away.
This is happening in production as well (that actually triggered this
analysis) but I don't necessarily see Adobe writer installed in production.
Is there anything else that when installed would change the behaviour of
AutoExec as I have mentioned ?
If you have any ideas as to how can I avoid this, that would be great.