Shape.WebTextBox property (Publisher)

Returns the WebTextBox object associated with the specified shape.

Syntax

expression.WebTextBox

expression A variable that represents a Shape object.

Return value

WebTextBox

Example

This example creates a new web text box, specifies default text, indicates that entry is required, and limits entry to 50 characters.

Dim shpNew As Shape 
Dim wtbTemp As WebTextBox 
 
Set shpNew = ActiveDocument.Pages(1).Shapes _ 
 .AddWebControl(Type:=pbWebControlSingleLineTextBox, _ 
 Left:=100, Top:=100, Width:=150, Height:=15) 
 
Set wtbTemp = shpNew.WebTextBox 
 
With wtbTemp 
.DefaultText = "Please Enter Your Full Name" 
 .RequiredControl = msoTrue 
 .Limit = 50 
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.