0

I am working with MS Word 2007 in VB.NET using the PIAs.

Specifically I am doing some processing on multiple Word.Document objects in memory which are part of the same Word.Application object. Can I process each Word.Document in a separate thread or does Word automation require a single thread?

Thanks,

Jacob

Jacob
  • 453
  • 5
  • 17
  • The Office object is not single threaded. [Walkthrough: Multithreading with the BackgroundWorker](http://msdn.microsoft.com/en-us/library/ywkkz4s1.aspx) – Arno Sep 20 '13 at 17:02
  • The walkthrough you linked to doesn't address office at all. Also, you say that is isn't single threaded, but is it also thread safe? – Jacob Sep 20 '13 at 18:03

1 Answers1

-2

The Interlocked Class of Multithreaded Programming with Visual Basic .NET lets you you safely increment, decrement, exchange, and compare values from any thread. See also Writing Code in Office Solutions and How to: Target Office Applications Through Primary Interop Assemblies.

Arno
  • 4,994
  • 3
  • 39
  • 63
  • Down voted with no comment! Can anyone explain why this isn't a good idea? – Matt Jun 13 '18 at 15:23
  • Your answer does not respond to "Can I process each Word.Document in a separate thread or does Word automation require a single thread?" – Tarik Apr 21 '19 at 17:29