vb Code:
Sub ActionDoc()
Dim GMC As Object, WordDoc As Object
On Error Resume Next
'-- See if any existing Word application is open
Set GMC = GetObject(, "Word.application")
On Error GoTo 0
If GMC Is Nothing Then
'-- If no instance found, Create one
Set GMC = CreateObject("Word.application")
End If
'-- Change path as applicable
Set WordDoc = GMC.Documents.Open("c:\temp\temp.doc")
'-- Show word
GMC.Visible = True
'-- Type something in word
With GMC.Selection
.TypeText Text:=" Xyz"
.TypeParagraph
.TypeText Text:=" xyz"
End With
'-- Disable alerts
GMC.DisplayAlerts = False '-- <===Toggle this to see what I mean
'-- Close Document without saving
WordDoc.Close
Set WordDoc = Nothing
'-- Quit Word
GMC.Quit
Set GMC = Nothing
End Sub