Type Property

Applies To

CommandBar object, CommandBarButton object, CommandBarComboBox object, CommandBarControl object, CommandBarPopup object, DocumentProperty object.

Description

DocumentProperty object: Returns or sets the document property type. Can be one of the following MsoDocProperties constants: msoPropertyTypeBoolean, msoPropertyTypeDate, msoPropertyTypeFloat, msoPropertyTypeNumber, or msoPropertyTypeString. Read-only for built-in document properties; read/write for custom document properties.

CommandBar object: Returns the type of command bar. Can be one of the following MsoBarType constants: msoBarTypeNormal, msoBarTypeMenuBar, or msoBarTypePopup. Read-only Long.

CommandBarControl object: Returns the type of command bar control. Read-only Long.

Can be one of the following MsoControlType constants.

Constant

Control type

msoControlButton

msoControlButtonDropdown

msoControlButtonPopup

msoControlComboBox

msoControlCustom

Reserved for future use.

MsoControlDropdown

msoControlEdit


(continued)

Constant

Control type

msoControlExpandingGrid

msoControlGauge

msoControlGenericDropdown

Reserved for future use.

msoControlGraphicCombo

msoControlGraphicDropdown

msoControlGraphicPopup

Reserved for future use.

msoControlGrid

msoControlLabel

Reserved for future use.


(continued)

Constant

Control type

msoControlOCXDropDown

msoControlPopup

msoControlSplitButtonMRUPopup

msoControlSplitButtonPopup

msoControlSplitDropdown

msoControlSplitExpandingGrid

Reserved for future use.


Specifics (Microsoft Access)

In Microsoft Access 97, you can use the Toolbar Properties dialog box to change the type 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 select the new type for the menu bar, toolbar, or shortcut menu in the Type box. You can't change the type of a built-in menu bar, toolbar, or shortcut menu.

If you set the type of a command bar to "Popup", the command bar disappears from the Toolbars list in the Customize dialog box, and moves to the menu bar that's displayed when you select the Shortcut Menus box in the Toolbars list (this menu bar displays all the shortcut menus in Microsoft Access).

Example

This example finds the first control with the tag value "Change this bar." If the control with that tag value is a command bar button, the example adds a new combo box control to the end of the command bar and changes the tag value of the found button to "Changed."

Set ctrl = CommandBars _
    .FindControl(Tag:="Change this bar")
If ctrl Is Nothing Then Goto notFound
If ctrl.Type = msoControlButton Then
    Set br = ctrl.Parent
    br.Controls.Add(Type:=msoControlComboBox)
    ctrl.Tag = "Changed"
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