Error in programmatic launch of 2nd winword.exe instance (Word 200

M

Martin Pozor

I am creating software using c# which silently opens word document, saves it
to some location and closes it. It uses
Microsoft.Office.Interop.Word.ApplicationClass, so new winword.exe process
(hidden to user) is launched and after operation completes, process is closed.

This works fine with Word 2003. With Word 2007 it works as well, but there
is one problem. Instantiating Word ApplicationClass fails when 2 conditions
are met: another winword.exe instance is running (user has already some
document opened) and there is some dot or dotx template in Word startup
folder. In that case, Word shows message, that this template is locked for
editing by first instance of Word and therefore cannot be loaded when
launching sencond winword.exe instance. I remind, Word 2003 has no problem
with this situation, problems occurs only in 2007.

I will really appreciate any try to help me.

But please, don't tell me, that only solution is using
Marshal.GetActiveObject("Word.Application") and reusing already running
winword.exe process in that situation. I already tried that, it works, but
there are many consequent problems: for example it doesn't work when some
modal dialog is just shown in Word, there are also problems with hidden
winword.exe process which is used in Outlook 2003 for html email editing and
other. Simply, I have good reasons to want to keep this functionality
isolated in separate winword.exe process.

So is there any way of achieving similar behavior of Word 2007 like Word
2003. How to avoid "xxx.dot is locked for editing" message?

Thank you very much.
 
K

koms

hi Martin,

i am kinda facing the same issue !! have you received any feedback from MS
?? has anyone confirmed this as a BUG in word 2007 ??? Also are you using any
work arounds for the moment regarding this issue... any help would be really
appreciated !!

thanks,
koms
 

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