opening a word document

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I too have encountered this problem.
I attempted to use the suggestion but when I enter the code:

Dim oApp As Object

Set oApp = CreateObject("Word.Application")
oApp.Visible = True
oApp.Document.Open "C:\Documents and Settings\u8ra10\My
Documents\AltCreditPendDoc.doc"

I get this error message: "Object doesn't support this property or method"
How can I fix this?
 
I think you need another var

Dim oDoc as Object

and change the line

set oDoc = oApp.Document.Open "C:\Documents and Settings\u8ra10\My
Documents\AltCreditPendDoc.doc"


if that does not fix it, then it may be the spaces in the path above.
 
Do you actually need word automaton here, or just want to open the document?

If you just want to open the document, you can use:


application.FollowHyperlink "C:\Documents and
Settings\u8ra10\MyDocuments\AltCreditPendDoc.doc"
 
Albert

I think your right, sometimes I cannot see the wood for the trees.
 
Alex White MCDBA MCSE said:
Albert

I think your right, sometimes I cannot see the wood for the trees.

Actually, not much of a issue either way. We actually don't know, or can't
tell if automation is needed here. So, having two solutions is still good.
And, really, at the end of day, your attitude is one of trying to help, and
contribute to this group. Really, can't complain either way..can we??
 
It IS Documents! Thanks a lot. Document was the solution offered in an
earlier post!
 
It should read OpenDocuments not OpenDocument

Alex White MCDBA MCSE said:
I think you need another var

Dim oDoc as Object

and change the line

set oDoc = oApp.Document.Open "C:\Documents and Settings\u8ra10\My
Documents\AltCreditPendDoc.doc"


if that does not fix it, then it may be the spaces in the path above.


--
Regards

Alex White MCDBA MCSE
http://www.intralan.co.uk
 
Hi,

I have a related problem. I am using automation 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?!?

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 vsDos contains my file name.

I am obviosly missing something here. Any advice?

Thanks in advance.
Regards,
D
 

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

Back
Top