扩展帮助指的是档鼠标悬停在按钮上,出现的更多关于该按钮的描述信息,包括文字和图片,甚至视频。最终用户就不需要查阅帮助手册就能快速的了解该按钮的相关功能。
API提供了对应的能力,实现自定义按钮的扩展帮助。以下VBA代码演示了流程。当然,最终创建按钮需要用插件。
Public Sub ProgressiveToolTips()
Dim g_FilePath As String
g_FilePath = "C:\temp\"
' Create the button definition.
Dim smallIcon As IPictureDisp
Set smallIcon = LoadPicture(g_FilePath & "SmallProgTooltip.bmp")
Dim largeIcon As IPictureDisp
Set largeIcon = LoadPicture(g_FilePath & "LargeProgTooltip.bmp")
Dim buttonDef As ButtonDefinition
Set buttonDef = ThisApplication.CommandManager.ControlDefinitions.AddButtonDefinition("Sample1", "SampleCommand", kQueryOnlyCmdType, "", "Sample command to show progressive tool tips.", "Sample", smallIcon, largeIcon)
' Add a control to the Work Feature panel of the Model tab of the Part ribbon.
Call ThisApplication.UserInterfaceManager.Ribbons.Item("Part").RibbonTabs.Item("id_TabModel").RibbonPanels.Item("id_PanelA_ModelWorkFeatures").CommandControls.AddButton(buttonDef, True)
' Define the progressive tooltip. This would typically be done in the
' same section of code where the button definition is created but there's
' a problem with the beta version where the progressive tooltip can only
' be defined on a control has been created.
With buttonDef.ProgressiveToolTip
.Description = "The short description."
.ExpandedDescription = "This is the long expaned version of the description that could have a more complete description to accompany the picture."
Dim progImage As IPictureDisp
Set progImage = LoadPicture(g_FilePath & "koala.jpg")
.Image = progImage
.IsProgressive = True
.Title = "Sample1"
End With
End Sub