WebTextBox Object

Microsoft Publisher Visual Basic

WebTextBox Object

Shape WebTextBox

Represents a Web text box control. The WebTextBox object is a member of the Shape object.

Using the WebTextBox object

Use the AddWebControl method to create new Web option button. Use the WebTextBox property to access a Web text box control shape. This example creates a new Web text box, specifies default text, indicates that entry is required, and limits entry to 50 characters.

Sub CreateWebTextBox()
    With ActiveDocument.Pages(1).Shapes
        With .AddWebControl(Type:=pbWebControlSingleLineTextBox, _
                Left:=100, Top:=100, Width:=150, Height:=15).WebTextBox
            .DefaultText = "Please Enter Your Full Name"
            .RequiredControl = msoTrue
            .Limit = 50
        End With
    End With
End Sub