473,558 Members | 2,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(containin g
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 1571
<ph*****@vistat ec.ie> wrote in message
news:a3******** *************** ***@posting.goo gle.com...
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(containin g
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***@microsof t.com> wrote in message news:<Oy******* *******@TK2MSFT NGP09.phx.gbl>. ..
<ph*****@vistat ec.ie> wrote in message
news:a3******** *************** ***@posting.goo gle.com...
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(containin g
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*****@vistat ec.ie> wrote in message
news:a3******** *************** ***@posting.goo gle.com...
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
7719
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 how this would work with class objects. In this case do you have to push the object on the stack at the start of every public procedure etc. in the...
4
6722
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 defined) name. For example: reactors = for reac in reactors: reac = Reactor()
1
3166
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 looking for, but nothing that really solves or explains all this. I'll admit to being stumped, hence my question here. I'm also trying to make...
7
2259
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
462
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. I can not transfer a report to word without losing out on the lay-out (RTF format). I understand that there is no way out ok, mail merge I...
1
1761
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 application(notepad/word) that opened/ceated the file. Thanks alot.
2
2256
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 in any place other than the default website? I do not want to install it there as our IIS has multiple websites, but nowhere is there an option when...
7
6227
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 user and populated (with info from an Access database) at run-time, then saved as Word documents. The program I have coded works fine -- it does...
1
7083
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 someone who bothers to read all of it have some pointers. Note, I have posted the stack trace and the code exhibiting the problem further down...
0
7549
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7835
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8061
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7593
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7914
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1164
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.