Name Property
Applies To
Assistant object, Balloon object, BalloonCheckbox object, BalloonCheckboxes collection object, BalloonLabel object, BalloonLabels collection object, CommandBar object, DocumentProperty object, FileFind object, PropertyTest object.
Description
Returns or sets the name of the specified object. Read/write String for the CommandBar object, read-only String for all other objects.
Remarks
The local name of a built-in command bar is displayed in the title bar (when the command bar isn't docked) and in the list of available command bars wherever that list is displayed in the container application.
For a built-in command bar, the Name property returns the command bar's U.S. English name. Use the NameLocal property to return the localized name.
If you change the value of the LocalName property for a custom command bar, the value of Name changes as well, and vice versa.
See Also
NameLocal property.
Specifics (Microsoft Access)
In Microsoft Access 97, you can use the Toolbar Properties dialog box to change the name of a custom menu bar, toolbar, or shortcut menu. Point to Toolbars on the View menu and click Customize, then click the Properties button in the Customize dialog box. Select the custom menu bar, toolbar, or shortcut menu you want in the Selected Toolbar box, and then enter the new name in the Toolbar Name box. You can't change the name of a built-in menu bar, toolbar, or shortcut menu.
Example
This example searches the collection of command bars for the command bar named "Custom." If this command bar is found, the example makes it visible.
foundFlag = False
For Each bar In CommandBars
If bar.Name = "Custom" Then
foundFlag = True
bar.Visible = True
End If
Next
If Not foundFlag Then
MsgBox "'Custom' bar isn't in collection."
Else
MsgBox "'Custom' bar is now visible."
End If
This example displays the name, type, and value of a document property. You must pass a valid DocumentProperty object to the procedure.
Sub DisplayPropertyInfo(dp As DocumentProperty)
MsgBox "value = " & dp.Value & Chr(13) & _
"type = " & dp.Type & Chr(13) & "name = " & dp.Name
End Sub