AddWebControl Method

       

Adds a new Shape object representing a Web Form Control to the specified Shapes collection.

expression.AddWebControl(Type, Left, Top, Width, Height, LaunchPropertiesWindow)

expression   Required. An expression that returns one of the objects in the Applies To list.

Type  Required PbWebControlType. Specifies the type of Web form control to add.

PbWebControlType can be one of these PbWebControlType constants.
pbWebControlCheckBox  Adds a checkbox.
pbWebControlCommandButton  Adds a command button.
pbWebControlHTMLFragment  Not used for this method.
pbWebControlListBox  Adds a list box.
pbWebControlMultiLineTextBox  Adds a multiple-line text area.
pbWebControlOptionButton  Adds an option button.
pbWebControlSingleLineTextBox  Adds a single-line textbox.
pbWebControlWebComponent  Not used for this method.

Left  Required Variant. The position of the left edge of the shape representing the Web form control.

Top  Required Variant. The position of the top edge of the shape representing the Web form control.

Width  Required Variant. The width of the shape representing the Web form control. For command buttons, this parameter is ignored.

Height  Required Variant. The height of the shape representing the Web form control. For command buttons, this parameter is ignored.

LaunchPropertiesWindow  Optional Boolean. Not supported. Default is False; an error occurs if this argument is set to True.

Remarks

For the Left, Top, Width, and Height arguments, numeric values are evaluated in points; strings can be in any units supported by Microsoft Publisher (for example, "2.5 in").

Example

The following example adds a Web form checkbox control to the first page of the active publication.

Dim shpCheckBox As Shape

Set shpCheckBox = ActiveDocument.Pages(1).Shapes.AddWebControl _
    (Type:=pbWebControlCheckBox, _
    Left:=216, Top:=216, _
    Width:=18, Height:=18)