A family of Microsoft word processing software products for creating web, email, and print documents.
Hi Charles,
Thanks for your reply.
My code is sort of similar as yours.
Sub StartWDFromXL()
Dim oWdApp As Word.Application
Dim oWdDoc As Word.Document
On Error Resume Next
Set oWdApp = GetObject(, "Word.Application")
If Err Then
Set oWdApp = New Word.Application
Err.Clear
End If
On Error GoTo Err_Handler
oWdApp.Visible = True
oWdApp.Activate
Set oWdDoc = oWdApp.Documents.Add
oWdDoc.Range.Text = "New Doc"
Set oWdApp = Nothing
Set oWdDoc = Nothing
Exit Sub
Err_Handler:
MsgBox Err.Number & " " & Err.Description
End Sub
It does not work.