All Products
Search
Document Center

Intelligent Media Management:Word

Last Updated:Oct 29, 2024

This topic describes the API operations for Word documents.

PageFitType

Specifies whether to zoom in or zoom out the view size to fit the document window size.

  • Syntax

    expression.Enum.PageFitType.wdPageFitNone

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdPageFitNone

    0

    Do not adjust the view settings for the page.

    wdPageFitFullPage

    1

    View the entire page.

    wdPageFitBestFit

    2

    Best fit the page to the active window.

    wdPageFitTextFit

    3

    Best fit the text of the page to the active window.

BasePoint

Specifies a base point for alignment.

  • Syntax

    expression.Enum.BasePoint.leftTop

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    leftTop

    left-top

    The upper-left vertex.

    rightTop

    right-top

    The upper-right vertex.

    rightBottom

    right-bottom

    The lower-right vertex.

    leftBottom

    left-bottom

    The lower-left vertex.

    center

    center

    The center.

WdAutoFitBehavior

Specifies how Word resizes a table when the AutoFit feature is enabled.

  • Syntax

    expression.Enum.WdAutoFitBehavior.wdAutoFitFixed

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdAutoFitFixed

    0

    Sets the table to a fixed size regardless of its content.

    wdAutoFitContent

    1

    Automatically resizes the table to fit its content.

    wdAutoFitWindow

    2

    Automatically resizes the table to fit the width of the active window.

WdBreakType

Specifies the type of break.

  • Syntax

    expression.Enum.WdBreakType.wdPageBreak

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdPageBreak

    1

    Line break.

    wdColumnBreak

    2

    Column break at the insertion point.

    wdTextWrappingBreak

    3

    Ends the current line and forces the text to continue below a picture, table, or other item. The text continues on the next blank line that does not contain a table which is aligned with the left or right margin.

    wdSectionBreakNextPage

    4

    Section break on the next page.

    wdSectionBreakContinuous

    5

    New section without a corresponding page break.

    wdSectionBreakEvenPage

    6

    Section break that begins the next section on the next even-numbered page. If the section break falls on an even-numbered page, Word leaves the next odd-numbered page blank.

    wdSectionBreakOddPage

    7

    Section break that begins the next section on the next odd-numbered page. If the section break falls on an odd-numbered page, Word leaves the next even-numbered page blank.

WdCellVerticalAlignment

Specifies the vertical alignment of text in one or more cells of a table.

Syntax

  • expression.Enum.WdCellVerticalAlignment.wdCellAlignVerticalTop

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdCellAlignVerticalTop

    1

    Aligns text to the top border of the cell.

    wdCellAlignVerticalCenter

    2

    Aligns text to the center of the cell.

    wdCellAlignVerticalBottom

    3

    Aligns text to the bottom border of the cell.

WdColorIndex

Specifies the color that you want to apply.

  • Syntax

    expression.Enum.WdColorIndex.wdByAuthor

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdByAuthor

    -1

    The color that is defined by the document author.

    wdAuto

    0

    Automatic color. In most cases, the default value is black.

    wdBlack

    1

    Black.

    wdBlue

    2

    Blue.

    wdTurquoise

    3

    Turquoise.

    wdBrightGreen

    4

    Bright green.

    wdPink

    5

    Pink.

    wdRed

    6

    Red.

    wdYellow

    7

    Yellow.

    wdWhite

    8

    White.

    wdDarkBlue

    9

    Dark blue.

    wdTeal

    10

    Teal.

    wdGreen

    11

    Green.

    wdViolet

    12

    Purple.

    wdDarkRed

    13

    Dark red.

    wdDarkYellow

    14

    Dark yellow.

    wdGray50

    15

    Shade 50 of gray.

    wdGray25

    16

    Shade 25 of gray.

WdContentControlType

Specifies the type of content control.

  • Syntax

    expression.Enum.WdContentControlType.wdContentControlRichText

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdContentControlRichText

    0

    Specifies a rich-text content control.

    wdContentControlText

    1

    Specifies a text content control

    wdContentControlPicture

    2

    Specifies a picture content control.

    wdContentControlComboBox

    3

    Specifies a combo box content control.

    wdContentControlDropdownList

    4

    Specifies a drop-down list content control.

    wdContentControlBuildingBlockGallery

    5

    Specifies a building block gallery content control.

    wdContentControlDate

    6

    Specifies a date content control.

    wdContentControlGroup

    7

    Specifies a group content control.

    wdContentControlCheckbox

    8

    Specifies a check box content control.

    wdContentControlRepeatingSection

    9

    Specifies a repeating section content control.

WdDefaultTableBehavior

Specifies whether Word automatically resizes cells in a table to fit the contents.

  • Syntax

    expression.Enum.WdDefaultTableBehavior.wdWord8TableBehavior

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdWord8TableBehavior

    0

    Disables AutoFit. This is the default value.

    wdWord9TableBehavior

    1

    Enables AutoFit.

WdDisplayDocumentFields

Specifies the type of document fields.

  • Syntax

    expression.Enum.WdDisplayDocumentFields.wpsNotDisplayDocumentFileds

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wpsNotDisplayDocumentFileds

    0

    Document fields are not displayed.

    wpsDisplayDocumentFields

    1

    Document fields and background color are displayed.

    wpsDisplayDocumentFieldsWithoutBackground

    2

    Document fields are displayed, but background color is not displayed.

WdExportCreateBookmarks

Specifies whether bookmarks are included when a document is exported.

  • Syntax

    expression.Enum.WdExportCreateBookmarks.wdExportCreateHeadingBookmarks

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdExportCreateHeadingBookmarks

    0

    Creates a bookmark in the exported document for each Word heading. Word heading includes the headings within the main document and text boxes. Word heading does not include the headings within headers, footers, endnotes, footnotes, or comments.

    wdExportCreateNoBookmarks

    1

    Specifies that bookmarks are not created in the exported document.

    wdExportCreateWordBookmarks

    2

    Creates a bookmark in the exported document for each Word bookmark, which includes all bookmarks except the bookmarks that are contained within headers and footers.

WdExportFormat

Specifies the format that you want to use to export a document.

  • Syntax

    expression.Enum.WdExportFormat.wdExportFormatPDF

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdExportFormatPDF

    17

    Exports the document into PDF format.

    wdExportFormatXPS

    18

    Exports the document into XML Paper Specification (XPS) format.

    wdExportFormatIMG

    19

    Exports the document into IMG format.

WdExportImgFormat

Specifies the format of the exported image.

  • Syntax

    expression.Enum.WdExportImgFormat.wdExportFormatPNG

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdExportFormatPNG

    0

    Exports the image into PNG format.

    wdExportFormatJPG

    1

    Exports the image into JPEG format.

    wdExportFormatBMP

    2

    Exports the image into BMP format.

    wdExportFormatTIF

    3

    Exports the image into TIFF format.

WdExportItem

Specifies whether to export the document with markup.

  • Syntax

    expression.Enum.WdExportItem.wdExportDocumentContent

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdExportDocumentContent

    0

    Exports the document without markup.

    wdExportDocumentWithMarkup

    7

    Exports the document with markup.

WdExportOptimizeFor

Specifies the resolution and quality of the exported document.

  • Syntax

    expression.Enum.WdExportOptimizeFor.wdExportOptimizeForOnScreen

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdExportOptimizeForPrint

    0

    Export for print, which is of higher quality and generates a larger file.

    wdExportOptimizeForOnScreen

    1

    Export for screen, which is of lower quality and generates a smaller file.

WdExportRange

Specifies the range of the document to export.

  • Syntax

    expression.Enum.WdExportRange.wdExportAllDocument

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdExportAllDocument

    0

    Exports the entire document.

WdGoToDirection

Specifies the position to which you want to move a selection or the insertion point in relation to an object or to itself.

  • Syntax

    expression.Enum.WdGoToDirection.wdGoToAbsolute

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdGoToAbsolute

    1

    An absolute position.

WdGoToItem

Specifies the type of the item before which you want to move the insertion point or selection.

  • Syntax

    expression.Enum.WdGoToItem.wdGoToPage

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdGoToBookmark

    -1

    A bookmark.

    wdGoToPage

    1

    A page.

WdHeaderFooterIndex

Returns a header or footer in a document or section.

Important

Only IMM WebOffice SDK for JavaScript V1.1.10 and later support this feature.

  • Syntax

    expression.Enum.WdHeaderFooterIndex.wdHeaderFooterPrimary

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdHeaderFooterPrimary

    1

    Returns the header or footer on all pages except the first page of a document or section.

    wdHeaderFooterFirstPage

    2

    Returns the first header or footer in a document or section.

    wdHeaderFooterEvenPages

    3

    Returns all headers or footers on even-numbered pages.

WdInformation

Specifies the type of information that is returned about a selection or range.

  • Syntax

    expression.Enum.WdInformation.wdActiveEndPageNumber

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdActiveEndPageNumber

    3

    Returns the number of the page that contains the active end of the specified selection or range, counting from the beginning of the document. Manual adjustments to page numbering are disregarded. This is different from counting.

    wdNumberOfPagesInDocument

    4

    Returns the number of pages in the document that are associated with the selection or range.

WdLineSpacing

Specifies the line spacing format to that you want to apply to a paragraph.

  • Syntax

    expression.Enum.WdLineSpacing.wdLineSpaceSingle

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdLineSpaceSingle

    0

    Single spacing. This is the default value.

    wdLineSpace1pt5

    1

    Space-and-a-half line spacing. Spacing is equivalent to the current font size plus 6 points.

    wdLineSpaceDouble

    2

    Double spacing.

    wdLineSpaceAtLeast

    3

    Line spacing is at least a value that is separately specified.

    wdLineSpaceExactly

    4

    Line spacing is only the exact maximum amount of space that is required. In most cases, this setting uses less space than single spacing.

    wdLineSpaceMultiple

    5

    Line spacing that is determined by the specified number of lines.

WdMovementType

Specifies the manner in which the selection is moved.

  • Syntax

    expression.Enum.WdMovementType.wdMove

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdMove

    0

    The selection is collapsed to an insertion point and moved to the end of the specified unit. This is the default value.

    wdExtend

    1

    The end of the selection is extended to the end of the specified unit.

WdRevisionType

Specifies the type of a change that is labeled with a revision mark.

  • Syntax

    expression.Enum.WdRevisionType.wdNoRevision

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdNoRevision

    0

    No revision.

    wdRevisionInsert

    1

    Insertion.

    wdRevisionDelete

    2

    Deletion.

    wdRevisionProperty

    3

    Property changed.

    wdRevisionStyle

    8

    Style changed.

WdRevisionsView

Specifies which version of a document is displayed.

  • Syntax

    expression.Enum.WdRevisionsView.wdRevisionsViewFinal

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdRevisionsViewFinal

    0

    Displays the document version with formatting and content changes applied.

    wdRevisionsViewOriginal

    1

    Displays the original document, which does not contain changes made.

WdRowHeightRule

Specifies the rule for determining the height of cells or rows.

  • Syntax

    expression.Enum.WdRowHeightRule.wdRowHeightAuto

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdRowHeightAuto

    0

    The row height is adjusted to accommodate the tallest value in the row.

    wdRowHeightAtLeast

    1

    The row height is at least a minimum specified value.

    wdRowHeightExactly

    2

    The row height is an exact value.

WdRulerStyle

Specifies the manner in which Word adjusts the table when the left indent is changed.

  • Syntax

    expression.Enum.WdRulerStyle.wdAdjustNone

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdAdjustNone

    0

    Adjusts the left edge of a row or rows, which preserves the width of all columns by shifting the columns to the left or right. This is the default value.

    wdAdjustProportional

    1

    Adjusts the left edge of the first column to maintain the position of the right edge of the table by proportionally adjusting the width of all cells in the specified row or rows.

    wdAdjustFirstColumn

    2

    Adjusts the left edge of only the first column, which preserves the positions of the other columns and the right edge of the table.

    wdAdjustSameWidth

    3

    Adjusts the left edge of the first column, which preserves the position of the right edge of the table by setting the widths of all the cells in the specified row or rows to the same value.

WdTabLeader

Specifies the character that you want to use as the leader with formatted tabs.

  • Syntax

    expression.Enum.WdTabLeader.wdTabLeaderDashes

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdTabLeaderSpaces

    0

    Spaces.

    wdTabLeaderDots

    1

    Dots.

    wdTabLeaderDashes

    2

    Dashes.

    wdTabLeaderLines

    3

    Lines.

    wdTabLeaderHeavy

    4

    A heavy line.

WdUnits

Specifies the unit of measure that you want to use.

  • Syntax

    expression.Enum.WdUnits.wdCharacter

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdCharacter

    1

    A character.

    wdWord

    2

    A word.

    wdSentence

    3

    A sentence.

    wdParagraph

    4

    A paragraph.

    wdLine

    5

    A line.

    wdStory

    6

    A story.

    wdScreen

    7

    The screen dimensions.

    wdSection

    8

    A section.

    wdColumn

    9

    A column.

    wdRow

    10

    A row.

    wdWindow

    11

    A window.

    wdCell

    12

    A cell.

    wdCharacterFormatting

    13

    The character formatting.

    wdParagraphFormatting

    14

    The paragraph formatting.

    wdTable

    15

    A table.

    wdItem

    16

    The selected item.

WdWrapType

Specifies how to wrap text around a shape.

  • Syntax

    expression.Enum.WdWrapType.wdWrapSquare

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdWrapSquare

    0

    Wraps text around the shape.

    wdWrapTight

    1

    Wraps text close to the shape.

    wdWrapThrough

    2

    Wraps text around the shape.

    wdWrapTopBottom

    4

    Warps text above and below the shape.

WpsWaterMarkApplyTo

Specifies the insertion position of a watermark.

  • Syntax

    expression.Enum.WpsWaterMarkApplyTo.wpsWaterMarkApplyToWholeSection

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wpsWaterMarkApplyToCurSection

    0

    The current section.

    wpsWaterMarkApplyToWholeSection

    1

    The entire document.

WpsWaterMarkType

Specifies the type of the watermark.

  • Syntax

    expression.Enum.WpsWaterMarkType.wpsNoWaterMark

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wpsNoWaterMark

    0

    No watermark.

    wpsTextWaterMark

    1

    A text watermark.

    wpsPictureWaterMark

    2

    An image watermark.

    wpsTextPictureWaterMark

    3

    A text watermark and an image watermark.

ZOrderCmd

Specifies the location in the z-order to which a shape is moved relative to other shapes.

  • Syntax

    expression.Enum.ZOrderCmd.bringInFrontOfText

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    bringInFrontOfText

    4

    Brings the shape in front of text.

    sendBehindText

    5

    Sends the shape behind text.

WdUnderline

Specifies the type of underline that you want to apply.

  • Syntax

    expression.Enum.WdUnderline.wdUnderlineSingle

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdUnderlineNone

    0

    No underline.

    wdUnderlineSingle

    1

    A single line.

    wdUnderlineWords

    2

    Underline only individual words.

    wdUnderlineDouble

    3

    A double line.

    wdUnderlineDotted

    4

    Dots.

    wdUnderlineThick

    6

    A single thick line.

    wdUnderlineDash

    7

    Dashes.

    wdUnderlineDotDash

    9

    Alternating dashes and dots.

    wdUnderlineDotDotDash

    10

    An alternating dot-dot-dash pattern.

    wdUnderlineWavy

    11

    A single wavy line.

    wdUnderlineWavyHeavy

    27

    A heavy wavy line.

    wdUnderlineDottedHeavy

    20

    Heavy dots.

    wdUnderlineDashHeavy

    23

    Heavy dashes.

    wdUnderlineDotDashHeavy

    25

    Alternating heavy dots and heavy dashes.

    wdUnderlineDotDotDashHeavy

    26

    An alternating heavy dot-dot-dash pattern.

    wdUnderlineDashLong

    39

    Long dashes.

    wdUnderlineDashLongHeavy

    55

    Long heavy dashes.

    wdUnderlineWavyDouble

    43

    A double wavy line.

WdConstants

Groups together constants that are used with various Word methods.

  • Syntax

    expression.Enum.WdConstants.wdUndefined

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdToggle

    9999998

    Toggles the value of a property.

    wdUndefined

    9999999

    Specifies an undefined value.

WdLineSpacingUnit

Specifies the unit that is used for line spacing.

  • Syntax

    expression.Enum.WdLineSpacingUnit.wdLineSpacePt

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdLineSpacePt

    0

    Pounds.

    wdLineSpaceInc

    1

    Inches.

    wdLineSpaceCm

    2

    Centimeters.

    wdLineSpaceMm

    3

    Millimeters.

WdBookmarkSortBy

Specifies the sorting option for bookmarks.

Syntax

  • expression.Enum.WdBookmarkSortBy.wdSortByLocation

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdSortByLocation

    1

    Sorts bookmarks by location in the document.

    wdLineSpaceInc

    0

    Sorts bookmarks by bookmark name.

WdStoryType

Specifies the story type of a selection or item.

Syntax

  • expression.Enum.WdStoryType.wdMainTextStory

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdCommentsStory

    4

    Comments story.

    wdEndnoteContinuationNoticeStory

    17

    Endnote continuation notice story.

    wdEndnoteContinuationSeparatorStory

    16

    Endnote continuation separator story.

    wdEndnoteSeparatorStory

    15

    Endnote separator story.

    wdEndnotesStory

    3

    Endnotes story.

    wdEvenPagesFooterStory

    8

    Even pages footer story.

    wdEvenPagesHeaderStory

    6

    Even pages header story.

    wdFirstPageFooterStory

    11

    First page footer story.

    wdFirstPageHeaderStory

    10

    First page header story.

    wdFootnoteContinuationNoticeStory

    14

    Footnote continuation notice story.

    wdFootnoteContinuationSeparatorStory

    13

    Footnote continuation separator story.

    wdFootnoteSeparatorStory

    12

    Footnote separator story.

    wdFootnotesStory

    2

    Footnotes story.

    wdMainTextStory

    1

    Main text story.

    wdPrimaryFooterStory

    9

    Primary footer story.

    wdPrimaryHeaderStory

    7

    Primary header story.

    wdTextFrameStory

    5

    Text frame story.

WdRestrictEditMode

Specifies the edit restriction type for the document.

Syntax

  • expression.Enum.WdRestrictEditMode.wdMainTextStory

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    wdEditModeDefault

    0

    Applies the default type.

    wdEditModeReadOnly

    1

    Allows read-only access to the document.

    wdEditModeTrackedChanges

    2

    Allows only revisions to be added to the existing content in the document.

    wdEditModeComments

    5

    Allows only comments to be added to the document.

    wdEditModeFillingInForms

    4

    Allows content to be added to the document only through form fields.

WdCommandBar

Specifies a style for all bars at the bottom of Word for mobile platforms.

Syntax

  • expression.Enum.WdCommandBar.ImgMode

    expression: an Application object.

  • Parameters

    Name

    Value

    Description

    DefaultMode

    0

    The default style (icons and text).

    ImgMode

    1

    Icons only.

    TextMode

    2

    Text only.