How to open specific word document?

Nader

Well-known member
Joined
Oct 9, 2008
Messages
55
Programming Experience
Beginner
This code below is to open a MS Word ... How can use it to open specific file example:
D:\Myfolder\MyWord.doc
Imports Word = Microsoft.Office.Interop.Word

' Create Word Application
Dim oWord As Word.Application = DirectCast(CreateObject("Word.Application"), Word.Application)

' Create new word document
Dim oDoc As Word.Document = oWord.Documents.Add()
oWord.Visible = True
 
Use the Open method instead of the Add method.
 
Back
Top