Automating Word in a service using WS2008 and Office2007

V

VinceG

I have a service running queued Word mailmerges which I am trying to get to
work under Windows Server 2008 and Office 2007 SP2. No matter what I try it
stubbornly refuses to open a docunment, either .doc or .docx. My service is a
small test app running under .Net Framework 3.5 and under a user in the
Administrators group which has full DCOM permissions. I have even disabled
UAC on the server but to no effect. It doesnt hang, but just fails to open
the document. Any ideas?

Heres the sample code which runs off a timer event:

Dim WordObj As Object ' Word.Application
Dim oWordDoc As Object ' Word.Document
Dim missing As Object = System.Reflection.Missing.Value
Dim MyFalse As Object = CObj(False)
Dim MyTrue As Object = CObj(True)
Dim DocCOunt As Integer
Try
WordObj = CreateObject("Word.Application")
'WordObj = New Word.Application
WordObj.Visible = False
oWordDoc = WordObj.Documents.Open("D:\TestApps\Test6.docx",
MyFalse, MyFalse, MyFalse, missing, missing, MyFalse, missing, missing, 0,
missing, MyFalse, MyFalse, 0, MyTrue)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top