Shapes.AddWebControl Method
Publisher Developer Reference |
Adds a new Shape object representing a Web form control to the specified Shapes collection.
Syntax
expression.AddWebControl(Type, Left, Top, Width, Height, LaunchPropertiesWindow)
expression A variable that represents a Shapes object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Type | Required | PbWebControlType | Specifies the type of Web form control to add. An error occurs if pbWebControlWebComponent is used. |
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. |
Return Value
Shape
Remarks
For the Left, Top, Width, and Height parameters, numeric values are evaluated in points; strings can be in any units supported by Microsoft Office Publisher (for example, "2.5 in").
When adding a hot spot to a Web control by using the pbWebControlHotSpot constant, the URL is specified by the Hyperlink property.
Note that the Shape.Fill property, which returns a FillFormat object, and the Shape.Line property, which returns a LineFormat object, cannot be accessed from a hot spot shape. A run-time error is returned if attempting to access these properties from a hot spot shape.
The Type parameter can be one of the PbWebControlType constants declared in the Microsoft Office Publisher type library and shown in the following table.
Constant | Description |
---|---|
pbWebControlCheckBox | Adds a check box. |
pbWebControlCommandButton | Adds a command button. |
pbWebControlHotSpot | Adds a hot spot. |
pbWebControlHTMLFragment | Adds an HTML fragment. |
pbWebControlListBox | Adds a list box. |
pbWebControlMultiLineTextBox | Adds a multiple-line text area. |
pbWebControlOptionButton | Adds an option button. |
pbWebControlSingleLineTextBox | Adds a single-line text box. |
pbWebControlWebComponent | Not used for this method. |
Example
The following example adds a Web form check box control to the first page of the active publication.
Visual Basic for Applications |
---|
|
The following example adds hot spots to a shape on page four of the active Web publication. First, a four-point star AutoShape is added to the page. Next, a hot spot is added to each arm of the star by using the AddWebControl method with a Type of pbWebControlHotSpot. Finally, a hyperlink is added to each hot spot by using the Hyperlink property of each hot spot shape.
Visual Basic for Applications |
---|
|
See Also