Automation of Word from Another Application:
Return to List
' ASSUMES that a valid reference has been made to the most current version of Word in the Visual Basic Editor for Automation purposes (of either VB6 or another Microsoft (or other) application). Also that the application is set to "BREAK ON UNHANDLED ERRORS"
' ******************************************************************* Dim WordApp As Object
On Error GoTo APPLICATION_CREATE' An error will cause us to initiate the Appl. Set WordApp = GetObject(, "Word.Application")
GoTo SKIP_APPLICATION_CREATE' Of course if it's already there, then we'll use that APPLICATION_CREATE:
Set WordApp = CreateObject("Word.Application")
SKIP_APPLICATION_CREATE:
On Error GoTo BYE' Back to our normal way of life' *********************************************************************