|
楼主 |
发表于 2014-8-15 16:37
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Public Function GetRibbonXML() As String
Dim sRibbonXML As String
'
'"<tab id=""CustomTab"" label=""sanjie"">" & _ 在功能区最后
'改成:
'"<tab id=""CustomTab"" label=""sanjie"" insertBeforeMso=""TabHome"">" & _ 在“开始”之前
'"<tab id=""CustomTab"" label=""sanjie"" insertAfterMso=""TabHome"">" & _ 在“开始”之后
sRibbonXML = "<customUI xmlns=""http://schemas.microsoft.com/office/2006/01/customui"" >" & _
"<ribbon>" & _
"<tabs>" & "<tab id=""CustomTab"" label=""iSpring Free"" insertBeforeMso=""TabHome"">" & "<group id=""SampleGroup1"" label=""发布"">" & _
"<button id=""Button1"" label=""快速发布"" size=""large"" imageMso=""GetImage"" onAction=""ll"" />" & "<button id=""Button2"" label=""发布"" size=""large"" imageMso=""GetImage"" onAction=""a2"" />" & _
"</group >" & "<group id=""SampleGroup2"" label=""插入"">" & "<button id=""Button3"" label=""测试"" size=""large"" imageMso=""GetImage"" onAction=""b1"" />" & _
"<button id=""Button4"" label=""flash"" size=""large"" imageMso=""GetImage"" onAction=""b2"" />" & "<button id=""Button5"" label=""You Tube"" size=""large"" imageMso=""GetImage"" onAction=""b3"" />" & _
"</group >" & "<group id=""SampleGroup3"" label=""关于"">" & "<button id=""Button6"" label=""更新"" size=""large"" imageMso=""GetImage"" onAction=""c1"" />" & _
"<button id=""Button7"" label=""关于"" size=""large"" imageMso=""GetImage"" onAction=""c2"" />" & "<button id=""Button8"" label=""升级为专业版"" size=""large"" imageMso=""GetImage"" onAction=""c3"" />" & _
"</group >" & "<group id=""SampleGroup4"" label=""关于我们"">" & "<button id=""Button9"" label=""FaceBook"" size=""large"" imageMso=""GetImage"" onAction=""d1"" />" & _
"</group >" & _
"</tab>" & _
"</tabs>" & _
"</ribbon>" & _
"</customUI>"
GetRibbonXML = sRibbonXML
End Function
'下面是调用资源文件(.res)中资源的函数。
'Button1用的是系统内置图标,无需调用。Button2和Button3用的是自定义图标
Function GetImage(control As IRibbonControl) As IPictureDisp
Select Case control.Id
Case "Button1"
Set GetImage = LoadResPicture(101, vbResBitmap) '调用资源文件中的位图作为功能区的图标
Case "Button2"
Set GetImage = LoadResPicture(102, vbResBitmap)
Case "Button3"
Set GetImage = LoadResPicture(103, vbResBitmap)
Case "Button4"
Set GetImage = LoadResPicture(104, vbResBitmap)
Case "Button5"
Set GetImage = LoadResPicture(105, vbResBitmap)
Case "Button6"
Set GetImage = LoadResPicture(106, vbResBitmap)
Case "Button7"
Set GetImage = LoadResPicture(107, vbResBitmap)
Case "Button8"
Set GetImage = LoadResPicture(108, vbResBitmap)
Case "Button9"
Set GetImage = LoadResPicture(109, vbResBitmap)
End Select
End Function |
|