Click here to Skip to main content
15,891,204 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there,

I try to open a Word document in a VB2010 service. This works fine on a PC with WXP/Word2007, however it will not run on a PC with W7/Word2010.

This code returns "_document=nothing":

VB
_document = _word.Documents.Open(FileName:=CType(psTemplate, Object), _
 ConfirmConversions:=False, _
 ReadOnly:=True, _
 AddToRecentFiles:=False, _
 PasswordDocument:=String.Empty, _
 PasswordTemplate:=String.Empty, _
 Revert:=False, _
 WritePasswordDocument:=String.Empty, _
 WritePasswordTemplate:=String.Empty, _
 Format:=0)



Many thanks,
Gerard
Posted
Updated 27-Sep-11 14:52pm
v2

1 solution

I don't know the exact reason, but I have faced the same issue with Office 2010.
The work around is to put some delay between application creation and document open or try opening document multiple times with some delay until it opens.
Just try it. I hope this helps.
 
Share this answer
 
Comments
Member 8023626 28-Sep-11 3:32am    
Hi Pretak,
Thanks for your reply. However for me this was not the solution. I solved it by changing the identity of the Word Component (with dcomcnfg) to "interactive user" instead of "launching user".

Gerard

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900