Option Explicit
Public objWord As Object 'instead of Word.Application
Public wd As Object 'instead of Word.Document
Private Sub Command1_Click()
If objWord Is Nothing Then
Set objWord = CreateObject("Word.Application")
Else
Set objWord = GetObject(, "Word.Application")
End If
DoEvents
Set wd = objWord.Documents.Open("c:\Test.doc")
'here u can do stuff with the document
'using the wd object
'adding some text to it
wd.ActiveWindow.Selection.TypeText "ABCDEFGH peet was here ! :-)"
'when finished manipulating the document, u can show it To the user
objWord.Visible = True
'quit word
If Not (wd Is Nothing) Then Set wd = Nothing
If Not (objWord Is Nothing) Then objWord.Application.Quit
If Not (objWord Is Nothing) Then Set objWord = Nothing
End Sub