Salesforce

Microsoft Word - Methods (Magic xpi 4.6)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

Microsoft Word - Methods

Use the following methods to configure the Microsoft Word component:

The following table lists the methods and parameters that can be used. Parameters in bold are mandatory.

Name

Parameters

Description

Bookmark executes actions on a bookmark.

Action

The action that you want to take. Select one of the following from the drop-down list:

  • GetCount

  • GetName

  • Add

  • Delete

  • Select

  • SetValue

Index Type

Select one of the following from the drop-down list:

  • Number

  • Name

Index Number

Bookmark by index number. This is the default index. This is available only when you select Number in the Index Type field (above).

Index Name

Bookmark by index name. This is available only when you select Name in the Index Type field (above).

Value

Bookmark content.

Name

Bookmark name on GetName and Add.

Count

Number of bookmarks.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Document Close closes the document.

Save Changes

Save on closing. Select one of the following from the drop-down list:

  • No

  • Yes

ErrorCode

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Document Open lets you open a Word document. If a document doesn't exist, this method will create one.

File Name

The full path name of the doc file, including the .doc extension. For example, My Documents\file1.doc

Read Only

Opens the file in read-only mode. Select one of the following from the drop-down list:

  • Yes

  • No

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Document Print lets you print the document or Set/Get the active printer.

Action

The action that you want to take. Select one of the following from the drop-down list:

  • Print

  • SetPrinter

  • GetPrinter

Copies

The number of copies.

Active Printer

The printer name.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Document Protect lets you Protect/Unprotect the document.

Protect

Enables you to prevent damage to the document by protecting it. Select No or Yes from the drop-down list.

Protection Type

Lets you set the type of protection that you want for the document. Select one of the following from the drop-down list:

  • AllowOnlyRevisions

  • AllowOnlyComments

  • AllowOnlyFormFields

No Reset Form Fields

Generates a No Reset Form Fields flag. Select one of the following from the drop-down list:

  • No

  • Yes

Password

Lets you set a password to protect the document.

The entered password will be masked by dots.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Document Save lets you save the document using the Save or Save As functions, in various formats.

Action

The action that you want to take. Select one of the following from the drop-down list:

  • Save

  • Save As

File Name

The full path name of the file, including the extension. For example, My Documents\file1.doc

This is available only when you select Save As in the Action field (above).

File Format

The format that you want to save the file in. Select one of the following from the drop-down list:

  • DOC

  • DOCX

  • HTML

  • Text

  • RTF

  • Template

  • PDF

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Form Field executes actions on form fields.

Action

The action that you want to take. Select one of the following from the drop-down list:

  • GetCount

  • GetName

  • SetName

  • Delete

  • Select

  • SetValue

  • GetValue

  • Unlink

Index Number

Form field by index number. This is the default index. This parameter is valid for all actions except GetCount.

Index Name

Form field by index name. This parameter is valid if the index number is 0, and is also valid for all actions except GetCount.

Value

Form field content. This parameter is valid only for the GetValue and SetValue actions.

Name

Form field name on the GetName and SetName actions..

Count

Number of form fields on the GetCount action.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Header Footer activates a document's headers or footers.

Action

The action that you want to take. Select ActivateHeader or ActivateFooter from the drop-down list.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Insert Objects lets you insert an object in to the document.

Type

The type of object that you want to insert. Select one of the following from the drop-down list:

  • File

  • Picture

  • PDF

  • FieldDate

  • FieldTime

  • FieldAuthor

  • FieldFileName

  • FieldPage

File Name

The full path name of the doc file, including the .doc extension. For example, My Documents\file1.doc

Insert Position

The position of the file that you want to insert. Select Current or LastPage from the drop-down list.

Height

The height of the object in points.

Width

The width of the object in points.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

List lets you set, get, or delete an entry from a list table.

Action

The action that you want to take. Select one of the following from the drop-down list:

  • Set

  • Get

  • Delete

Number

This parameter is the record number in the list table. If this parameter is left blank, or defined as 0 in conjunction with the Delete action, the complete list table will be deleted.

Value

This parameter is valid only for Set or Get actions.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

List to XML lets you generate the list table records in an XML file format. This is relevant only if you selected GetList in the Action parameter of the Paragraph method.

XML File Name

This is the XML file created by the last GetList Action. The User BLOB will contain the XML result.

Source File Name

This is the source file name used for the last GetList action in the Paragraph method.

Sort By

Defines the order in which the output will be generated. Select one of the following from the drop-down list:

  • Number

  • Row

  • Column

XML Result

This parameter returns the output in XML format.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Macro lets you activate a macro that is contained in a document.

Macro Name

The name of the macro that you want to activate.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Paragraph executes actions on selected paragraphs.

Action

The action that you want to take. Select one of the following from the drop-down list:

  • GetCount

  • Delete

  • Select

  • SetValue

  • GetValue

  • GetList

Index Number

The index number. This is mandatory for some operations.

List From Index

The range from the index number for the GetList action.

List To Index

The range to the index number for the GetList action.

Clear Invalid Characters

Lets you clear invalid characters from the text. Select one of the following from the drop-down list:

  • No

  • Yes

Value

Indicates the paragraph content.

Count

Indicates the number of paragraphs.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Quit lets you quit Word. It is recommended to use this method at the end of processing to remove Microsoft Word from the Windows Task Manager.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Selection Format lets you format the selected object. The object can be a table, a row, a column, a cell, a paragraph, a form field, or a bookmark. You should define a specific area before using this command.

Font Name

Lets you select the desired font.

Font Size

Lets you select the desired font size.

Font Color

Lets you select the desired font color.

Font Style

Lets you select the desired font style. Select one of the following from the drop-down list:

  • Bold

  • -Bold

  • Underline

  • -Underline

  • Italic

  • -Italic

  • Outline

  • -Outline

  • Shadow

  • -Shadow

  • Strikethrough

  • -Strikethrough

Background Color

Lets you select the cell background color.

Alignment

Lets you select the desired alignment for the selection. Select one of the following from the drop-down list:

  • Left

  • Center

  • Right

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Selection Move lets you move or extend the selection of the specified unit according to the specified action. However, not all units are available for all actions.

Action

The action that you want to take. Select one of the following from the drop-down list:

  • Move To

  • Home

  • End

  • Up

  • Down

  • Left

  • Right

Unit

The unit that you want to move. Select one of the following from the drop-down list:

  • wdCharacter

  • wdWord

  • wdSentence

  • wdParagraph

  • wdLine

  • wdStory

  • wdScreen

  • wdSection

  • wdColumn

Number Of Units

The number of the units that you want to move.

Move or Extend

Lets you choose whether to extend or move a unit. Select one of the following from the drop-down list:

  • Move

  • Extend

Number Of Units Moved

Tells you the number of units that were moved.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Selection Text lets you Get or Set a text in the selection area. This method is relevant only after you have used the Selection Move method.

Action

The action that you want to take. Select one of the following from the drop-down list:

  • GetValue

  • SetValue

Clear Invalid Characters

Lets you clear invalid characters from the text. Select one of the following from the drop-down list:

  • No

  • Yes

Value

The value that you want to Get or Set.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Table executes an operation on a table.

Action

The action that you want to take. Select one of the following from the drop-down list:

  • Activate

  • ActivateHeader

  • ActivateFooter

  • GetRowsCount

  • GetColumnsCount

  • Select

  • Delete

  • SelectRow

  • AddRow

  • CopyRow

  • DeleteRow

  • GetRowCellsCount

  • SelectColumn

  • AddColumn

  • CopyColumn

  • DeleteColumn

  • GetPageBreaks

  • SetPageBreaks

  • SetHeadingFormat

  • GetDirection

  • SetDirection

  • GetAlignment

  • SetAlignment

Number

Represents the table number.

Row or Column number

Lets you define the row or column that you want to Copy, Delete, or Select.

Insertion Point

Lets you define the insertion point, before the row number or the column number.

Heading Format

Gives you the option of formatting the header or the footer. Select one of the following from the drop-down list:

  • No

  • Yes

Allow Page Break

Lets you Get or Set a page break. The valid values are No and Yes.

Table Direction

Lets you Get or Set the table direction.

Rows Alignment

Lets you Get or Set the rows alignment page break property.

Count

Counts the rows, columns, or cells.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Table Cell executes operations on a table cell.

Action

The action that you want to take. Select one of the following from the drop-down list:

  • SetValue

  • GetValue

  • SetProperties

  • Select

  • Clear

Row

The table row.

Column

The table column.

Font Name

The font that you want to use.

Font Size

The font size that you want to use.

Font Color

The font color that you want to use.

Font Style

The font style that you want to use.

Background Color

The cell background color that you want to use.

Value

The cell value.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Tables lets you define the actions on the table.

Action

The action that you want to take. Select one of the following from the drop-down list:

  • GetCount

  • Create

Number Of Rows

The number of rows that the action will create.

Number Of Columns

The number of columns that the action will create.

Add Position

Lets you add the table at either the start of the document or at the end of it. Select one of the following from the drop-down list:

  • Start

  • End

Count

Counts the number of tables in the document.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

XML Execute lets you create a document in an XML format, according to a template document and a set of commands described in an XML file.

XML File Name

The full path XML name. (You need to supply either the XML name or the XML BLOB)

XML BLOB

The full path XML BLOB. (You need to supply either the XML name or the XML BLOB)

Word Document Name

The full path of the new Word document name.

Error Code

The operation error code.

Click to open the Variables List. Select a variable where the error code is returned, and then click Select.

Related Topics

How to Use Direct Access Methods

Reference
Attachment 
Attachment