MicrosoftWord Connector

Use the MicrosoftWord connector to integrate Word text and events into a solution. You can use the connector in automations to write and read text from book marked documents or templates.

When you add this component to an automation, the system places it on the Global tab of the component tray. For more information, see Adding Global Components to an Automation. This component must be global to be referenced by other automations in the project.

For more information, see General Component Properties, Methods, and Events.

 

Properties

Property

Description

Changes

Specifies the save changes action taken when the document is closed. The options are:

  • Save - Changes are saved when the document is closed

  • DoNotSave - Changes are not saved when the document is closed

Document

Use the Document property to specify the name of the document file name you want to use in the solution. You must specify a document to use the component. By default, Studio looks at the exact file path selected. However, the Folder property lets you determine the folder file path that is resolved at runtime using predefined tokens. You select these tokens from a list which includes options such as Deployment, Temporary, System and so on. The folder file path is then resolved by the selected token instead.

Mode

Mode governs how the connector file is opened. When set to Create (the default), Studio creates a file if it did not already exist. The Open setting makes sure a file is not created, but will try opening the designated file instead. If there is no document present when Studio tries to open it, the system shows an error message.

Template

Use the Template property to specify the template you want to use in the solution. You can either work with Documents or Templates. The Folder property for a template works the same way it does for a document.  

SupportedName

This property indicates the corresponding Office name for the Word program used.

SupportedVersion

Displays the version number of the Word program used.

Version

Indicates the current running version of Microsoft Word.

Visible

Visible is a Boolean property that indicates whether or not the main Word window is visible during solution runtime.  

WordApplication

Microsoft Word COM instance.

WordDocument

Microsoft Word document COM instance.

 

 

 

Events

 

Event

Description

AfterMailMerge

Occurs after a mail merge operation ends.

BeforeMailMerge

Occurs before a mail merge operation ends.

DocumentChanged

Occurs when a document is created, when a document is opened, or when another document is made the active document.

DocumentClosed

Occurs when the current document is closed.

DocumentOpened

Occurs when a document is opened.

DocumentPrinted

Occurs when the current document is printed.

DocumentSaved

Occurs when the current document is saved.

NewDocument

Occurs when a document is created.

Quit

Occurs when the main Word window is closed manually.

SelectionChange

Occurs when the current document selection changes.

WindowActivate

Occurs when the Word main window is activated.

WindowDeactivate

Occurs when the Word main window is deactivated.

 

Methods

Method

Description

Parameters

Result Type

Close

Closes a currently opened document.

None

Void

Open (1 Parameter)

Opens a new document using the supplied file name.

String document

Void

RunMacro (1 Parameter)

Runs a Visual Basic macro or calls a function.

String Macroname

Object

RumMacro (6 Parameters)

Runs a Visual Basic macro or calls a function. All param1-parm5 parameters are optional.

String + Optional Parameters

Object

Save

Saves the currently opened document. A True result is returned if the document was successfully saved.

None

Boolean

SaveAs (1 Parameter)

 

Saves the currently opened document under a new file name. If you do not specify the path, the document is saved in the My Documents folder for the user. A True result is returned if the document was successfully saved.

String Filename

Boolean

 

Related information

Using the MicrosoftWord Connector

 


Privacy | Trademarks | Terms of Use | Feedback

Updated: 18 June 2020

© 2016 - 2020 Pegasystems Inc.  Cambridge, MA All rights reserved.

 

OpenSpan data classification label