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 ' *********************************************************************

See also:
Access . . . Automating Database Compaction (every 5 times)
Excel . . . Automating Access (Reports)
Excel . . . Automating Internet Explorer from Excel
Excel . . . Outlook Automation from within Excel
Excel . . . Powerpoint Automation (complex!) from within Excel
Excel . . . Word Automation from Excel
VB6 . . . Automating Outlook (send email via code)
VB6 . . . Automation of multiple applications (type ext)
VB6 . . . Code (via Automation) to Import Tab-Delimited File into Excel
VB6 . . . Determining File Association (uses API)
VB6 . . . Excel chart creation through Automation
VB6 . . . Outlook Automation



Note to Webmaster