By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,014 Members | 1,015 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,014 IT Pros & Developers. It's quick & easy.

when multiple word objects are running

P: n/a
hi,

I have a program which waits for batches documents to be dropped into
a folder, once this happens, a class which activates the word object
is instaniated per batchg of docs & a number of things such as
spellchecking grammer checking etc are done. When one batch(containing
one or more docs) is dropped in, everything works fine, but when
multple batches are dropped in(ie many classes of the same class are
instaniated, weird things starts to happen. For example it complains
about custom dictionary not available, or exceptions are generated
when the ends of arraylists are reached.

Does anyone know why this is happening & what I can do to solve this?

thx
-Philip
Nov 15 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
<ph*****@vistatec.ie> wrote in message
news:a3**************************@posting.google.c om...
I have a program which waits for batches documents to be dropped into
a folder, once this happens, a class which activates the word object
is instaniated per batchg of docs & a number of things such as
spellchecking grammer checking etc are done. When one batch(containing
one or more docs) is dropped in, everything works fine, but when
multple batches are dropped in(ie many classes of the same class are
instaniated, weird things starts to happen. For example it complains
about custom dictionary not available, or exceptions are generated
when the ends of arraylists are reached.


Hi,

Is this program running as a service, or is it on an interactive desktop?
Office is not supported in server / service scenarios.

How do you connect to the Word object? Do you create a new instance, or try
to attach to a running instance? I imagine that you are creating multiple
WinWord processes and they are having problems accessing shared resources
because they're not really designed to be automated from two places at once.

Can you modify your code to ensure that only one instance of Word is ever
started up? Also if you are creating threads to handle each document or
other tricky things like that then Word will get upset at you.

Peter

--
Please post questions to the newsgroup - everyone benefits.
This post is provided "AS IS" with no warranties, and confers no rights
Sample code subject to http://www.microsoft.com/info/cpyright.htm
Bore yourself to tears -- http://blogs.gotdotnet.com/ptorr
Nov 15 '05 #2

P: n/a
"Peter Torr \(MS\)" <pt***@microsoft.com> wrote in message news:<Oy**************@TK2MSFTNGP09.phx.gbl>...
<ph*****@vistatec.ie> wrote in message
news:a3**************************@posting.google.c om...
I have a program which waits for batches documents to be dropped into
a folder, once this happens, a class which activates the word object
is instaniated per batchg of docs & a number of things such as
spellchecking grammer checking etc are done. When one batch(containing
one or more docs) is dropped in, everything works fine, but when
multple batches are dropped in(ie many classes of the same class are
instaniated, weird things starts to happen. For example it complains
about custom dictionary not available, or exceptions are generated
when the ends of arraylists are reached.


Hi,

Is this program running as a service, or is it on an interactive desktop?
Office is not supported in server / service scenarios.

How do you connect to the Word object? Do you create a new instance, or try
to attach to a running instance? I imagine that you are creating multiple
WinWord processes and they are having problems accessing shared resources
because they're not really designed to be automated from two places at once.

Can you modify your code to ensure that only one instance of Word is ever
started up? Also if you are creating threads to handle each document or
other tricky things like that then Word will get upset at you.

Peter

Hi Peter,

I presume it's a service scenaro, as no interaction is expected.

I create an instance of the word object per batch of documents. Must I
process all these documents sequentially? Is there no way I can
multitask this?

thx
-Philip
Nov 15 '05 #3

P: n/a
<ph*****@vistatec.ie> wrote in message
news:a3**************************@posting.google.c om...
I create an instance of the word object per batch of documents. Must I
process all these documents sequentially? Is there no way I can
multitask this?


No, you can only call into the Word OM on the main thread (and any calls
from other threads will be marshalled to the main thread).

Peter

--
Please post questions to the newsgroup - everyone benefits.
This post is provided "AS IS" with no warranties, and confers no rights
Sample code subject to http://www.microsoft.com/info/cpyright.htm
Bore yourself to tears -- http://blogs.gotdotnet.com/ptorr
Nov 15 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.