vbNewbie
vbNewbie

Reputation: 3345

Creating word object with office.interops

I am using the office interop to open word documents and saving as html to do parsing work. After a few executions I notice that in the task manager under processes there are still instances of WINWORD.EXE running. I have used the following to close the object but it is still there

wordApp.Quit()
wordApp = Nothingenter code here

How do I close this in order to avoid overhead? Any ideas appreciated

Upvotes: 0

Views: 122

Answers (3)

Matt Dearing
Matt Dearing

Reputation: 9386

If the word documents you are processing are docx files, then they would be based on the OpenXml standard(Office OpenXml). DOCX files are really just zip files. You can reference the DocumentFormat.OpenXml.dll (OpenXML SDK) and process docx files without the office interop dll's (and therefore the winword.exe process never actually starts up). This also gives you the benefit of not having Microsoft Word installed on the machine running your program.

Upvotes: 1

ZippyV
ZippyV

Reputation: 13018

It might have happened during testing where you stopped debugging your code and wordApp.Quit() didn't get executed.

Upvotes: 2

Zach Johnson
Zach Johnson

Reputation: 24212

This other SO question may help you. It's related to Outlook, but the same principles should apply.

Upvotes: 3

Related Questions