vbscript getVisible

注意:Для»»`动态菜单`подходиттоже!

Office XML_32
getVisible="CallbackGetVisible"
Office VBA_34
Option Explicit
  
Public bolVisible As Boolean
    Sub CallbackGetVisible(control As IRibbonControl, ByRef visible)
    visible = bolVisible
End Sub

vbscript 图库 - OnAction + selectedId

Office VBA_33
Sub OnActionGallery(control As IRibbonControl, _
                     selectedId As String, _
                     selectedIndex As Integer)
    Select Case control.ID
        Case Else
            Select Case selectedId
                Case Else
                    MsgBox "The selected ItemID of Gallery-Control """ & control.ID & """ is : """ & selectedId & """" & vbCrLf & _
                           "Die selektierte ItemID des Gallery-Control """ & control.ID & """ ist : """ & selectedId & """", _
                           vbInformation
            End Select
    End Select
End Sub

vbscript 图库 - getItemHeight

注意:Для»»“width”аналогично!

Office XML_31
getItemHeight="CallbackGetItemHeight"
Office VBA_32
Sub CallbackGetItemHeight(control As IRibbonControl, ByRef height)
    Select Case control.ID
        Case "MyPictureGallery1"
'           width
            height = 50
    End Select
End Sub

vbscript DropDown - getSelectedItemIndex

注意:Для»»`Gallery`аналогично。

Office XML_30
<dropDown 
 id="myDropDown" 
 label="My Dropdown:" 
 imageMso="PictureEffectsGlowGallery" 
 getSelectedItemIndex="CallbackDDGetSelectedItemIndex" 
 onAction="CallbackDropDownOnAction" 
 sizeString= "WWWWWWWWWWWWW">
</dropDown>
Office VBA_31
Sub CallbackDDGetSelectedItemIndex(control As IRibbonControl, ByRef index)
    Select Case control.ID
        Case "myDropDown"
            index = 2  
    End Select
End Sub

vbscript DropDown - getSelectedItemID

Office XML_29
<dropDown 
 id="myDropDown" 
 label="My Dropdown:" 
 imageMso="PictureEffectsGlowGallery" 
 getSelectedItemID="CallbackDDGetSelectedItemID" 
 onAction="CallbackDropDownOnAction" 
 sizeString= "WWWWWWWWWWWWW">
</dropDown>
Office VBA_30
Sub CallbackDDGetSelectedItemID(control As IRibbonControl, ByRef itemID)
    Select Case control.ID
        Case "myDropDown"
            itemID = "03a"
    End Select
End Sub

vbscript DropDown - onAction

注意:Для»»`Gallery`аналогично。

Office XML_28
<dropDown 
 id="myDropDown" 
 label="My Dropdown:" 
 imageMso="PictureEffectsGlowGallery"
 getItemCount="CallbackDDGetItemCount"
 getItemID="CallbackDDGetItemID"
 getSelectedItemID="CallbackDDGetSelectedItemID"
 onAction="CallbackDropDownOnAction" 
 sizeString= "WWWWWWWWWWWWW">
</dropDown>
Office VBA_29
Sub CallbackDropDownOnAction(control As IRibbonControl, _
                             selectedId As String, _
                             selectedIndex As Integer)
    Select Case control.ID
        Case "myDropDown"
            MsgBox "У вас " & DLookup("txtName", _
                   "tblPictures", "txtPicName = '" & _
                   Format(selectedIndex, "00") & "'") & _
                   " выбрано!", vbInformation, _
                   "Это заголовок!"
    End Select
End Sub

vbscript Combobox - onChange

Office XML_27
<comboBox 
 id="myComboBox" 
 label="My ComboBox:"
 imageMso="PictureEffectsGlowGallery" 
 onChange="MyComboBoxCallbackOnChange" 
 sizeString= "WWWWWWWWWWWWW">
</comboBox>
Office VBA_28
Sub MyComboBoxCallbackOnChange(control As IRibbonControl, strText As String)
    Select Case control.ID
        Case "myComboBox"
            MsgBox "You have " & strText & " selected", _
                   vbInformation, _
                   "ComboBox Sample"
    End Select
End Sub

vbscript Combobox - getItemSuperTip

注意:Для»»`DropDown`аналогично!

Office XML_26
<comboBox 
 id="myComboBox" 
 label="My ComboBox:"
 getItemSupertip="CallbackCBGetItemSupertip" 
 imageMso="PictureEffectsGlowGallery" 
 onChange="MyComboBoxCallbackOnChange" 
 sizeString= "WWWWWWWWWWWWW">
</comboBox>
Office VBA_27
Sub CallbackCBGetItemSupertip(control As IRibbonControl, _
                              index As Integer, _
                              ByRef supertip)
    Select Case control.ID
        Case "myComboBox"
            supertip = Nz(DLookup("txtSubName", "tblPictures", _
                                  "txtPicName='" & _
                                  Format(index, "00") & "'"), " ")
    End Select
End Sub

vbscript Combobox - getItemScreenTip

注意:Для»»`DropDown`和`Gallery`аналогично!

Office XML_25
<comboBox 
 id="myComboBox" 
 label="My ComboBox:"
 getItemScreentip="CallbackCBGetItemScreentip" 
 imageMso="PictureEffectsGlowGallery" 
 onChange="MyComboBoxCallbackOnChange" 
 sizeString= "WWWWWWWWWWWWW">
</comboBox>
Office VBA_26
Sub CallbackCBGetItemScreentip(control As IRibbonControl, _
                               index As Integer, _
                               ByRef screentip)
    Select Case control.ID
        Case "myComboBox"
            screentip = DLookup("txtName", "tblPictures", _
                                "txtPicName='" & _
                                Format(index, "00") & "'")
    End Select
End Sub

vbscript Combobox - getItemLabel

注意:Для»»`DropDown`和`Gallery`аналогично!

Office XML_24
<comboBox 
 id="myComboBox" 
 label="My ComboBox:"
 getItemLabel="CallbackCBGetItemLabel" 
 imageMso="PictureEffectsGlowGallery" 
 onChange="MyComboBoxCallbackOnChange" 
 sizeString= "WWWWWWWWWWWWW">
</comboBox>
Office VBA_25
Sub CallbackCBGetItemLabel(control As IRibbonControl, _
                           index As Integer, _
                           ByRef label)
    Select Case control.ID
        Case "myComboBox"
            label = DLookup("txtName", "tblPictures", _
                            "txtPicName='" & _
                            Format(index, "00") & "'")
    End Select
End Sub