Name Method

Microsoft Publisher Visual Basic

expression.Name(Index)

expression    Required. An expression that returns one of the objects in the Applies To list.

Index   Required Long. The index number of the hidden field.

Example

This example creates a Web command button with a hidden field, then displays the field's name.

Sub GetHiddenWebFieldName()
    With ActiveDocument.Pages(1).Shapes.AddWebControl _
            (Type:=pbWebControlCommandButton, _
            Left:=100, Top:=100, Width:=100, _
            Height:=36).WebCommandButton.HiddenFields
        .Add Name:="User", Value:="Power"
        MsgBox "The name of the first hidden field is " & .Name(1)
    End With
End Sub