Word Automation Issue

D

daviep

Hi,

I have a problem regarding OLE automation. I need to open a Word 9.0
document from Access using VBA code. The document opens, however I receive a
'File in Use' popup notifying me that the file is already in use by me and is
only available in read only?!?

I have used the following code to open the document:

' Open document
wdApp.Documents.Open FileName:=vsDoc, ReadOnly:=False,
AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="", Revert:=False,
WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto

where wdApp is my object and vsDoc contains my file name.

I am obviosly missing something here. Any advice?

Thanks in advance.
Regards,
D
 
T

Tatakau

This is how I open mine... seems to do the trick.

strFileSpec = DataPath() & "Letters\Confirmation Letter.doc"
Application.Follow Hyperlink strFileSpec

hth,

Nick
 
L

Larry Daugherty

Your problem is in the Word space, not Access. Post your question
into microsoft.public.word.programming or other Word groups.

HTH
 

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