Open Word doc

R

Ruas

It's possible to replace ("C:\MyDoc.doc") by the link I
have in a field?

Here is the sample:

Dim objWord As Word.Application
Set objWord = CreateObject("Word.Application")
With objWord
.Visible = True
.Documents.Open ("C:\MyDoc.doc")
(...)
Any idea?
Thanks.

Ruas
 
J

Joel Wiseheart

You could pass is as a variable to the function:

Public Function OpenWordDocument (strPath as String)
'Variables: strPath = Path to applicable Word document.

Dim objWord As Word.Application
Set objWord = CreateObject("Word.Application")
With objWord
.Visible = True
.Documents.Open (strPath)
End With
.....any other code here......

End Function
 

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