Outlook COM Add-in with WORD

Add-in Express™ Support Service
That's what is more important than anything else

Outlook COM Add-in with WORD
 
Donald


Guest


Hi there,

i looking at using Add-in Express and i want to use it with an outlook COM Add-in but i want to open and close word with it like this? because at the mo i can;t get it too

dim wordApp As Word.Application
wordApp = CreateObject("Word.Application")
wordDoc = wordApp.Documents.Open("C:\letter.doc")

does other stuff

wordApp.Quit(Word.WdSaveOptions.wdDoNotSaveChanges)

but this doesn't quit word why is this and how do i get round this??

Thanks

Donald
Posted 04 Jan, 2006 04:50:35 Top
Sergey Grischenko


Add-in Express team


Posts: 7225
Joined: 2004-07-05
Hi Donald.

I would change the code as shown below:

dim wordApp As Word.Application
wordApp = CreateObject("Word.Application")
wordDoc = wordApp.Documents.Open("C:\letter.doc")
...
Marshal.ReleaseComObject(wordDoc)
wordApp.Quit(Word.WdSaveOptions.wdDoNotSaveChanges)
Marshal.ReleaseComObject(wordApp)

Please try it.
Posted 04 Jan, 2006 15:32:14 Top