WebCheckBox Object

Microsoft Publisher Visual Basic

WebCheckBox Object

Shape WebCheckBox

Represents a Web check box control. The WebCheckBox object is a member of the Shape object.

Using the WebCheckBox object

Use the AddWebControl method to create new Web check box. Use the WebCheckBox property to access a Web check box control shape. This example creates a new Web check box and specifies that its default state is checked; then it adds a text box next to it to describe it.

Sub CreateNewWebCheckBox()
    With ActiveDocument.Pages(1).Shapes
        With .AddWebControl(Type:=pbWebControlCheckBox, Left:=100, _
                Top:=123, Width:=17, Height:=12).WebCheckBox
            .Selected = msoTrue
        End With
        With .AddTextbox(Orientation:=pbTextOrientationHorizontal, _
                Left:=118, Top:=120, Width:=70, Height:=15)
            .TextFrame.TextRange.Text = "Power User?"
        End With
    End With
End Sub