jetyun
asked on
Open Word document from VB?
I m not sure which method is recommended to open a word document from VB? Pls advise.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Add reference to Microsoft Word Object Library 8.0
PAste the code in a button click event.
Dim Obj As New Word.Application
Obj.Documents.Open "Whole path of your document"
Obj.Visible = True
PAste the code in a button click event.
Dim Obj As New Word.Application
Obj.Documents.Open "Whole path of your document"
Obj.Visible = True
Can it be done without a refrence to Word?
'first goto-project-references-se
dim oword as object
dim wrddoc as object
dim blnrunning as boolean
On Error Resume Next
Set oword = GetObject(, "word.application")
If Err.Number <> 0 Then
Set oword = CreateObject("word.applica
oword.Visible = True
blnrunning = False
Else
blnrunning = True
End If
AppActivate (oword)
Set WRDDOC = oword.Documents.Add