Skip to main content

Examples: GetObject function

The following script works on the Mac with Microsoft™ Word installed.

Sub Initialize
Dim myDoc As Variant
Dim filename As String

filename = "MKashG4HD:MSTestDoc"

'Get the Word.Document object from a file.
Set myDoc = GetObject(filename,"Word.Document")

' Make the object visible
myDoc.Application.Visible = True
End Sub