Word instance is not loading existing word document

S

Sidi

Hi,

I am creating instance of word in asp.net by using following code

Public WithEvents wrdApp As Word.Application

wrdApp = New Word.Application

.......

when code reaches to

' Add a new document.

wrdDoc = wrdApp.Documents.Open(Server.MapPath(strSrcFileName))

code hangs without giving any exception. I dont want to see the document I
want to load and perform mail merge.A day before it was running fine on the
same PC but next day its not doing automation on my PC ans simply hangs. It
is creating instance of word but then nothing happens please tell me is this
an issue of rights or code? and what will be the approperiate approach to do
this work

Sidi
 
C

Cindy M.

Hi Sidi,

Word was never designed to be run without user interaction. It can be automated
with Visible = False, but if Word throws up a message that requires a user
response your code will appear to hang.

I suggest you run it with Visible = True to find out if a message is being
displayed, and which one.
I am creating instance of word in asp.net by using following code

Public WithEvents wrdApp As Word.Application

wrdApp = New Word.Application

.......

when code reaches to

' Add a new document.

wrdDoc = wrdApp.Documents.Open(Server.MapPath(strSrcFileName))

code hangs without giving any exception. I dont want to see the document I
want to load and perform mail merge.A day before it was running fine on the
same PC but next day its not doing automation on my PC ans simply hangs. It
is creating instance of word but then nothing happens please tell me is this
an issue of rights or code? and what will be the approperiate approach to do
this work

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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 :)
 

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