CapeSoft Accessories for Clarion
Error in site JavaScript
Starting 2nd instance of word
Graeme Healey
APR 12,2013
Replies: 2
 
Assigned To: Geoff Thomson
 
Graeme Healey
APR 11,2013
11:20
Assigned To: Geoff Thomson

Hi Geoff, I have a process that retrieves the relevant data and then builds a document with table at the end. Document is then saved and left open (at this stage I have not killed the Com instance).  Leaving the first doc open, if I then run the process again a new document is created all OK, but the issue is it opens a 2nd instance of word. If you look at the attached debug lines, it tests and seems to find that word is already open, yet it opens another instance of word.

I am using  IF WordDoc.Init (0, 0) = 1  to initialise the process.

Is this normal, as I would like if possible to just have one instance of word open.

Thanks

Graeme
C8 and OI 4.12

Geoff Thomson
APR 12,2013
15:20

You can't control the same instance of word from 2 different threads, as the COM interfaces are threaded - so opening a new "instance" of the COM class will require it's own instance of word running.

Graeme Healey
APR 12,2013
17:32

Thanks Geoff I thought as much.