Share via


Type Property

Type property as it applies to the CommandBar object.

MsoBarType

MsoBarType can be one of these MsoBarType constants.
msoBarTypeMenuBar
msoBarTypeNormal
msoBarTypePopup

expression.Type

*expression   * Required. An expression that returns a CommandBar object.

Type property as it applies to the CommandBarButton, CommandBarComboBox, CommandBarControl, and CommandBarPopup objects.

MsoControlType

MsoControlType can be one of these MsoControlType constants.
msoControlActiveX
msoControlAutoCompleteCombo
msoControlButton
msoControlButtonDropdown
msoControlButtonPopup
msoControlComboBox
msoControlCustom
msoControlDropdown
msoControlEdit
msoControlExpandingGrid
msoControlGauge
msoControlGenericDropdown
msoControlGraphicCombo
msoControlGraphicDropdown
msoControlGraphicPopup
msoControlGrid
msoControlLabel
msoControlLabelEx
msoControlOCXDropdown
msoControlPane
msoControlPopup
msoControlSpinner
msoControlSplitButtonMRUPopup
msoControlSplitButtonPopup
msoControlSplitDropdown
msoControlSplitExpandingGrid
msoControlWorkPane

expression.Type

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

Type property as it applies to the SearchScope object.

MsoSearchIn

MsoSearchIn can be one of these MsoSearchIn constants.
msoSearchInCustom
msoSearchInMyComputer
msoSearchInMyNetworkPlaces
msoSearchInOutlook

expression.Type

*expression   * Required. An expression that returns a SearchScope object.

Type property as it applies to the DocumentProperty object.

Returns or sets the document property type. Read-only for built-in document properties; read/write for custom document properties.

expression.Type

*expression   * Required. An expression that returns a DocumentProperty object.

Remarks

MsoDocProperties

MsoDocProperties can be one of these MsoDocProperties constants.
msoPropertyTypeBoolean
msoPropertyTypeDate
msoPropertyTypeFloat
msoPropertyTypeNumber
msoPropertyTypeString

Example

As it applies to the CommandBar object.

This example finds the first control on the command bar named Custom. Using the Type property, the example determines whether the control is a button. If the control is a button, the example copies the face of the Copy button (on the Standard toolbar) and then pastes it onto the control.

Set oldCtrl = CommandBars("Custom").Controls(1)
If oldCtrl.Type = msoControlButton Then
    Set newCtrl = CommandBars.FindControl(Type:= _
        MsoControlButton, ID:= _
        CommandBars("Standard").Controls("Copy").ID)
    NewCtrl.CopyFace
    OldCtrl.PasteFace
End If

As it applies to the DocumentProperty object

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

Applies to | CommandBar Object | CommandBarButton Object | CommandBarComboBox Object | CommandBarControl Object | CommandBarPopup Object | DocumentProperty Object | SearchScope Object

See Also | Using Command Bars