Share via


Document.InsertInteractiveButton Method

SharePoint Designer Developer Reference

Inserts an interactive button into a document at the specified position.

Syntax

expression.InsertInteractiveButton(Range, styles, title, width, height, URL, target)

expression   Required. A variable that represents a Document object.

Parameters

Name Required/Optional Data Type Description
Range Required TextRange Specifies the position where the interactive button will be inserted. If the range specified includes text or elements, the button will replace these.
styles Required String String. Specifies the style that represents the appearance of the interactive button.
title Required String String. Specifies the text displayed on the button.
width Required Long Long. Specifies the width of the button.
height Required Long Long. Specifies the height of the button.
URL Optional Variant Variant. Specifies the URL that is opened when a user clicks the button in a browser.
target Optional Variant Variant. Specifies the target window in which to display the linked page. Corresponds to the settings for the target property.

Remarks

The styles parameter can be one or more of the following String values.

Note

Insert the value of the style after the colon. Separate multiple styles with a semicolon.

Value Description Example
fp-align-rect: Specifies the pixel coordinates for the original text alignment based on the source original image. Image scales appropriately for the preview. Coordinates are left, top, right, bottom or blank (default is the entire image). fp-align-rect: 0, 0, 50, 20
fp-align-rect1: Specifies the pixel coordinates for the hover text alignment based on the source hover image. Coordinates are left, top, right, bottom or blank (default is the entire image). fp-align-rect1: 0, 0, 50, 20
fp-align-rect2: Specifies the pixel coordinates for pressed text alignment based on the source pressed image. Coordinates are left, top, right, bottom or blank (default is the entire image). fp-align-rect2: 0, 0, 50, 20
fp-bgcolor: Specifies the default background color for the button. Any Web safe or named color value that is allowed for Cascading Style Sheets (default is white). Note: this property is not used for transparent buttons. fp-bgcolor: red
fp-btn: Specifies the internal name for a preset button. Preset button styles can be one of the following:
BorderBottom1 BrickColumn6 EmbossedCapsule7 GlassTab3
BorderBottom2 BrickColumn7 EmbossedCapsule8 GlassTab4
BorderBottom3 BrickColumn8 EmbossedCapsule9 GlassTab5
BorderBottom4 BrickColumn9 EmbossedRectangle1 GlowCapsule1
BorderBottom5 BrickRow1 EmbossedRectangle2 GlowCapsule2
BorderBottom6 BrickRow2 EmbossedRectangle3 GlowCapsule3
BorderBottom7 BrickRow3 EmbossedRectangle4 GlowCapsule4
BorderBottom8 BrickRow4 EmbossedRectangle5 GlowCapsule5
BorderBottom9 BrickRow5 EmbossedRectangle6 GlowCapsule6
BorderLeft1 BrickRow6 EmbossedRectangle7 GlowCapsule7
BorderLeft2 BrickRow7 EmbossedRectangle8 GlowCapsule8
BorderLeft3 BrickRow8 EmbossedRectangle9 GlowCapsule9
BorderLeft4 BrickRow9 EmbossedTab1 GlowRectangle1
BorderLeft5 ChainColumn1 EmbossedTab2 GlowRectangle2
BorderLeft6 ChainColumn2 EmbossedTab3 GlowRectangle3
BorderLeft7 ChainColumn3 EmbossedTab4 GlowRectangle4
BorderLeft8 ChainColumn4 EmbossedTab5 GlowRectangle5
BorderLeft9 ChainColumn5 EmbossedTab6 GlowRectangle6
BraidedColumn1 Corporate1 EmbossedTab7 GlowRectangle7
BraidedColumn2 Corporate2 EmbossedTab8 GlowRectangle8
BraidedColumn3 Corporate3 EmbossedTab9 GlowRectangle9
BraidedColumn4 Corporate4 GlassCapsule1 GlowTab1
BraidedColumn5 Corporate5 GlassCapsule2 GlowTab2
BraidedRow1 Corporate6 GlassCapsule3 GlowTab3
BraidedRow2 Corporate7 GlassCapsule4 GlowTab4
BraidedRow3 Corporate8 GlassCapsule5 GlowTab5
BraidedRow4 Corporate9 GlassRectangle1 GlowTab6
BraidedRow5 EmbossedCapsule1 GlassRectangle2 GlowTab7
BrickColumn1 EmbossedCapsule2 GlassRectangle3 GlowTab8
BrickColumn2 EmbossedCapsule3 GlassRectangle4 GlowTab9
BrickColumn3 EmbossedCapsule4 GlassRectangle5 Jewel1
BrickColumn4 EmbossedCapsule5 GlassTab1 Jewel1
BrickColumn5 EmbossedCapsule6 GlassTab2
fp-btn: Border Bottom 1
fp-font: Specifies the font name for the button text. fp-font: verdana
fp-font-color-hover: Specifies the font color for text for the hover state. Any Web safe or named color value that is allowed for Cascading Style Sheets (blank defaults to "Automatic"). fp-font-color-hover: black
fp-font-color-normal: Specifies the font color for the button text when in the normal state. Any Web safe or named color value that is allowed for Cascading Style Sheets (blank defaults to black). fp-font-color-normal: #FF0000
fp-font-color-pressed: Specifies the font color for button text when in the pressed state. Any Web safe or named color value that is allowed for Cascading Style Sheets or blank (blank equates to "Automatic"). fp-font-color-pressed: #00FF00
fp-font-size: Specifies the font size, measured in points, for the button text. fp-font-size: 10
fp-font-style: Specifies the font style characteristics for the button text. Can be Regular, Italic, Bold, and Bold Italic. fp-font-style: bold
fp-img-hover: Specifies whether Office SharePoint Designer creates a hover image for a checkbox button. Can be 0 or 1 (1 means true). fp-img-hover: 1
fp-img-pressed: Specifies whether Office SharePoint Designer creates a pressed image for a checkbox button. Can be 0 or 1 (1 means true). fp-img-pressed: 1
fp-justify-h: Specifies the horizontal alignment for the button text. Can be left, center, right or blank (default is center). fp-justify-h: left
fp-justify-v: Specifies the vertical alignment for button text. Can be top, center, bottom or blank (default is center). fp-justify-v: bottom
fp-preload: Specifies whether the images for a checkbox button are preloaded on the page. Can be 0 or 1 (1 means true). fp-preload: 0
fp-transparent: Specifies whether to use a solid or a transparent background for a radio button. Can be 0 or 1 (1 means transparent). fp-transparent: 1
fp-direction: Specifies whether the text is rendered as left-to-right or right-to-left. Can be "rtl" or "ltr". fp-direction: ltr

Example

The following example inserts an interactive button into the active document at the insertion point.

Visual Basic for Applications
Sub InsertNewInteractiveButton()
    Dim objDoc As DesignerDocument
    Dim objRange As TextRange
    Set objDoc = ActiveDocument
    Set objRange = objDoc.Selection.createRange
    objDoc.InsertInteractiveButton objRange, "fp-btn: Border Bottom 2", _
        "New Button", 100, 20, "http://www.microsoft.com", "_blank"
End Sub

See Also