Open Word doc

  • Thread starter Thread starter Ruas
  • Start date Start date
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
 
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
 
Back
Top