How do I use a seperate thread with word automation.

newguy

Well-known member
Joined
Jun 30, 2008
Messages
611
Location
Denver Co, USA
Programming Experience
1-3
Hi!

I have been trying to get word automation to run in a seperate thread, I have read that some Com object cannot operate on a seperate thread as they need windows to work. I'm also told not to use the background worker for this either, so how do I Open a template - add stuff - close and save - while doing all these things in the background - oh and release the Com objects - Word likes to stay running and hog memory - invisibly...

Thanks for help and insight...
 
I have read that some Com object cannot operate on a seperate thread as they need windows to work.
Word libraries are not ActiveX controls, I'm not aware of any problems doing Word automation in a thread. Is this a question actually? If so perhaps you could be more specific.
I'm also told not to use the background worker for this either
You said you got a MTA thread error for your work and were told how to run a STA thread. I have no problems running Word automation with a BackgroundWorker.
how do I Open a template
A template is loaded by specifying the Template parameter for Documents.Add method.
add stuff
How to automate Word from Visual Basic .NET to create a new document
close and save
Use the Close and Save method?
 
Back
Top