»ñÈ¡²Ëµ¥ºÍ¹¤¾ßÀ¸µÄÐÅÏ¢
ÔÚËùÓеÄOFFICE×é¼þÓ¦ÓóÌÐòÖж¼°üº¬ÓÐÄÚÖõŤ¾ßÀ¸£¬²¢ÇÒ¿ÉÒÔ½øÐнøÒ»²½µÄ×Ô¶¨ÒåÏÔʾÏà¹ØÃüÁËüÃÇÒ»¹²ÓÐÈýÖÖÀàÐÍ£º²Ëµ¥À¸£¬¹¤¾ßÀ¸ºÍµ¯³öʽ²Ëµ¥À¸(±¾Ö÷ÌâÒÔ¹¤¾ßÀ¸´ú±íÈýÖÖÀàÐÍÀ´ÃèÊö)¡£
Äã¿ÉÒÔÓÃÏÂÃæµÄÒ»¶Î³ÌÐòÔÚÁ¢¼´´°¿ÚÖÐÏÔʾËüÃǵÄËùÓеŤ¾ßÀ¸ÒÔ¼°¹¤¾ßÀ¸ÉÏËù°üº¬µÄÃüÁî¿Ø¼þ£º
Function CBPrintCBarInfo(strCBarName As String) As Variant
' This procedure prints (to the Debug window) information
' about the command bar specified in the strCBarName argument
' and information about each control on that command bar.
Dim cbrBar As CommandBar
Dim ctlCBarControl As CommandBarControl
Const ERR_INVALID_CMDBARNAME As Long = 5
On Error GoTo CBPrintCBarInfo_Err
Set cbrBar = Application.CommandBars(strCBarName)
Debug.Print "CommandBar: " & cbrBar.Name & vbTab & "(" _
& CBGetCBType(cbrBar) & ")" & vbTab & "(" _
& IIf(cbrBar.BuiltIn, "Built-in", "Custom") & ")"
For Each ctlCBarControl In cbrBar.Controls
Debug.Print vbTab & ctlCBarControl.Caption & vbTab & "(" _
& CBGetCBCtlType(ctlCBarControl) & ")"
Next ctlCBarControl
CBPrintCBarInfo_End:
Exit Function
CBPrintCBarInfo_Err:
Select Case Err.Number
Case ERR_INVALID_CMDBARNAME
CBPrintCBarInfo = "'" & strCBarName & _
"' is not a valid command bar name!"
Case Else
CBPrintCBarInfo = "Error: " & Err.Number _
& " - " & Err.Description
End Select
Resume CBPrintCBarInfo_End
End Function
Äã¿ÉÒÔÔÚACCESSµÄVisual Basic±à¼Æ÷ÖеÄÁ¢¼´´°¿ÚÖÐÔËÐÐÕâ¸öº¯ÊýµÃµ½ACCESSËùÓеIJ˵¥»ò¹¤¾ßÀ¸µÄÃüÁî°´Å¥£¬ÀýÈ磬¿ÉÒÔÔÚÁ¢¼´´°¿ÚÖмüÈëÒÔÏÂÃüÁ
? CBPrintCBarInfo(¡°Web¡±)
»Ø³µºóÄãÄÜÔÚÁ¢¼´´°¿ÚÖÐÏÔʾ³öWeb¹¤¾ßÀ¸Ëù°üº¬µÄËùÓÐÃüÁºÏ£¬ÈçÏÂͼ£º
740)this.width=740" border=undefined>
Èç¹ûÃüÁî°´Å¥µÄÀàÐÍÏÔʾΪ¡°Popup¡±Ê±£¬ ÀýÈç¡°ÊղؼС±Õâ¸öÃüÁîËü±¾Éí¾ÍÊÇÒ»¸öµ¯³öʽ¹¤¾ßÀ¸£¬ÄãͬÑù¿ÉÒÔÓñ¾º¯ÊýÀ´µÃµ½Ëü¸öÿһ¸öÃüÁî°´Å¥µÄÇåµ¥£¬È磺
? CBPrintCBarInfo(¡°favorites¡±)
Äã¿ÉÒÔÓÃÃû³Æ»ò¼¯ºÏË÷ÒýÀ´·ÃÎʹ¤¾ßÀ¸¼¯ºÏµÄÿ¸ö¹¤¾ßÀ¸£¬×¢ÒâÓëÆäËü¼¯ºÏ²»Í¬µÄÊÇËùÓм¯ºÏË÷Òý¶¼ÊÇ´Ó1¿ªÊ¼µÄ¡£