Using Macro to Close Word File

J

Jacob Skaria

Try the below. Make sure the name of word document is typed correctly....

Sub ControlWord()
Dim appWord As Object
Set appWord = GetObject(, "Word.Application")
appWord.Documents("Content Management.doc").Close False
End Sub
 
D

dwake

Tried that and it didnt work. The problem I'm having is closing the word
document after it has been used. Here is my code below. Any help would be
appreciated.

Sub WordToExcel()
Dim MyWd As Object
Set MyWd = GetObject("Audit Tracking.doc")

MyWd.ActiveWindow.Selection.WholeStory
MyWd.ActiveWindow.Selection.Copy

Sheet8.Range("A1").PasteSpecial xlPasteValues
End Sub
 
J

Jacob Skaria

Try

Sub ControlWord()
Dim appWord As Object
Set appWord = GetObject(, "Word.Application")
appWord.Documents("Audit Tracking.doc").ActiveWindow.Selection.Copy
Range("A1").PasteSpecial xlPasteValues
appWord.Documents("Audit Tracking.doc").Close False
End Sub
 
Top