473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

when multiple word objects are running

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
3 1564
<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
"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
<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Andrew | last post by:
Last night I was reading about implementing my own stack. The example given pushes items on and off the stack at the start and end of each procedure (ie. in a std module). What's not so clear is...
4
by: SilverShadow | last post by:
Hello, I'm having trouble with something that may be easily remedied. I use Cantera running on Python. I need to make multiple "Reactor()" objects and have them assigned a different (user...
1
by: Craig Ringer | last post by:
Hi folks I'm a bit of a newbie here, though I've tried to appropriately research this issue before posting. I've found a lot of questions, a few answers that don't really answer quite what I'm...
7
by: cgamache | last post by:
Which is a more correct statement? A destructor runs automatically when an object is deallocated. or A destructor runs automatically immediately before an object is deallocated.
11
by: svdh2 | last post by:
I have been looking at a problem the entire week in access, I have still not been able to find a solution. Hope that you could maybe tell where to look Concerns the link between Access and Word....
1
by: John | last post by:
It's been 30min and haven't seen my post yet (sorry to post twice). Q: How do I get the file name(which is opened) of a text/doc file if I have the process information of the...
2
by: Marcus | last post by:
I have seen many posts of people with the same problem as me (attached below), but I have yet to see any solutions posted. Has anyone figured out how to deploy an Asp.net web site to the webserver...
7
by: Dave | last post by:
Apologies for the newbie question. I have created a vb.net program for my company that is designed to work with Word Templates (about forty of them that we commonly use) that are selected by the...
1
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.