Name Property

Microsoft Publisher Visual Basic

Returns a String value indicating the name of the specified object. Read-only.

expression.Name

expression    Required. An expression that returns one of the above objects.

ShowName property as it applies to the BorderArtFormat, Font, Page, Shape, and ShapeRange objects.

Returns or sets a String value indicating the name of the specified object. Read/write.

expression.Name

expression    Required. An expression that returns one of the above objects.

Remarks

You can use an object's name in conjunction with the Item method or Item property to return a reference to the object if the Item method or property for the collection that contains the object takes a Variant argument. For example, if the value of the Name property for a shape is Rectangle 2, then .Shapes("Rectangle 2") will return a reference to that shape.

The Name property is the default property for the BorderArt, BorderArtFormat, and Label objects.

Example

ShowAs it applies to the ColorScheme object.

This example reports the name of the color scheme for the active publication.

MsgBox "The current color scheme is " _
    & ActiveDocument.ColorScheme.Name & "."
				

ShowAs it applies to the Font object.

This example formats a text frame on page one as Arial bold.

With ActiveDocument.Pages(1).Shapes(1) _
        .TextFrame.TextRange.Font
    .Name = "Arial"
    .Bold = True
End With