Parallel Access to Word

1

I'm occasionallyfacing problems when programmatically dealing with two or more Word documents simultaneously.

In my application I'm listening on the buttons of a Philips SpeechMike, of which one is used to save and close the Word document. There may be multiple process of my application (all listening on the buttons) which have zero or one word document.

When saving the different Word documents from my corresponding process I ran into COMException since I tried to enable this parallel usage: From C# with the Word Interop assemblies:

System.Runtime.InteropServices.COMException (0x800706BA): 
 Der RPC-Server ist nicht verf├╝gbar. (Ausnahme von HRESULT: 0x800706BA)
 bei Microsoft.Office.Interop.Word.Range.get_Start()

(eng.: The RPC-Server is not available. (Exception at HRESULT .....)

From C++: Calling saveObject() on an IContainer, HRESULT is 0x80004005 (Unspecified failure) and I'm also experiencing the upper 0x800706BA Error.

Both methods work fine as long as I only call to Word sequentially. So my question is: Are simultaneous parallel calls to one Word instance/process (but different documents) even supported, and if so: do I have to do some configuration in advance? E.g. changing the apartment?

I read (but can't find it anymore) that the default is STA apartment model and all calls are queued - which would mean I don't have to bother and it should work as it is!?

c#
c++
ms-word
com
office-interop
asked on Stack Overflow Mar 29, 2017 by Klaus Eckelt • edited Mar 29, 2017 by Klaus Eckelt

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0