Shape.WebCommandButton property (Publisher)

Returns the WebCommandButton object associated with the specified shape.

Syntax

expression.WebCommandButton

expression A variable that represents a Shape object.

Return value

WebCommandButton

Example

This example creates a web form Submit command button and sets the script path and file name to run when a user chooses the button.

Dim shpNew As Shape 
Dim wcbTemp As WebCommandButton 
 
Set shpNew = ActiveDocument.Pages(1).Shapes.AddWebControl _ 
 (Type:=pbWebControlCommandButton, Left:=150, _ 
 Top:=150, Width:=75, Height:=36) 
 
Set wcbTemp = shpNew.WebCommandButton 
 
With wcbTemp 
 .ButtonText = "Submit" 
 .ButtonType = pbCommandButtonSubmit 
 .ActionURL = "https://www.tailspintoys.com/" _ 
 & "scripts/ispscript.cgi" 
End With

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.