Examples: GetObject function

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

Dim myDoc As Variant
'Get the WordPro.Document object from a file. 
Set mydoc = getobject("d:\wordpro\docs\test.lwp","WordPro.Document")
' Call the Print method defined for WordPro.Document object.
myDoc.Print
 

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