Documents.add fails

T

techie

I have a C# application that creates an instance of Word 2003 and executes a
macro. The macro tries to create a new document using the code below:

Application.Documents.add(Template:=strAppPath & "\" &
"ErrMsgUserguide.dot", NewTemplate:=False, DocumentType:=0)

Every time this line fails. What could be causing this error?

If I run the macro from the MS Visual Basic IDE in Word it works fine.
Obviously calling the same macro from the C# application has something to do
with the problem. Any ideas?
 
C

Cindy M -WordMVP-

Hi Techie,
I have a C# application that creates an instance of Word 2003 and executes a
macro. The macro tries to create a new document using the code below:

Application.Documents.add(Template:=strAppPath & "\" &
"ErrMsgUserguide.dot", NewTemplate:=False, DocumentType:=0)

Every time this line fails. What could be causing this error?

If I run the macro from the MS Visual Basic IDE in Word it works fine.
Obviously calling the same macro from the C# application has something to do
with the problem.
With what error message is it failing?

Do you see anything different if you also include the fourth parameter
(Visible)?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
Top