Sub GetItemLabel(control As IRibbonControl, index As Integer, _
ByRef label)
Dim varItems As Variant
varItems = ActiveDocument.GetCrossReferenceItems(wdRefTypeHeading)
label = varItems(index + 1)
End Sub
Sub GetItemID(control As IRibbonControl, index As Integer, ByRef ID)
ID = “heading” & index
End Sub
现在,当打开下拉列表时,将显示文档中所有的标题。
(十) 组合单个的控件
缺省情况下,Ribbon确定添加到组中的控件的位置。如果想要更精确地定义控件的布局,可以在一个或多个框里组合控件。当创建一个框时,指定其方向(水平的或垂直的)。一个组可以包含多个框,可以在框之间包括垂直分隔。(通过使用separator控件创建垂直分隔,仅用于垂直框。)
下面的示例创建三个组,一个使用水平框,一个使用垂直框,还有一个没有框,如下图所示。
<group id=”CustomGroup1″ label=”Horizontal Boxes”
insertBeforeMso=”GroupClipboard”>
<box id=”box1″ boxStyle=”horizontal”>
<button id=”buttonA1″ label=”Button1″/>
<button id=”buttonA2″ label=”Button2″/>
</box>
<box id=”box2″ boxStyle=”horizontal”>
<button id=”buttonAA” label=”ButtonA”/>
<button id=”buttonAB” label=”ButtonB”/>
<button id=”buttonAC” label=”ButtonC”/>
</box>
</group>
<group id=”CustomGroup2″ label=”Vertical Boxes”
insertBeforeMso=”GroupClipboard”>
<box id=”box3″ boxStyle=”vertical”>
<button id=”buttonB1″ label=”Button1″/>
<button id=”buttonB2″ label=”Button2″/>
</box>
<separator id=”separator2″/>
<box id=”box4″ boxStyle=”vertical”>
<button id=”buttonBA” label=”ButtonA”/>
<button id=”buttonBB” label=”ButtonB”/>
<button id=”buttonBC” label=”ButtonC”/>
</box>
</group>
<group id=”CustomGroup3″ label=”No Boxes”
insertBeforeMso=”GroupClipboard”>
<button id=”buttonC1″ label=”Button1″/>
<button id=”buttonC2″ label=”Button2″/>
<button id=”buttonCA” label=”ButtonA”/>
<button id=”buttonCB” label=”ButtonB”/>
<button id=”buttonCC” label=”ButtonC”/>
</group>
图:不同的框样式
声明:欢迎各大网站转载本站文章,还请保留一条能直接指向本站的超级链接,谢谢!
第1页 | 第2页 | 第3页时间:2008-4-16 9:14:34,点击:0
上一篇:如何自定义Office 2007安装程序【声明】:以上文章或资料除注明为Office吧自创或编辑整理外,均为各方收集或网友推荐所得。其中摘录的内容以共享、研究为目的,不存在任何商业考虑。如有任何异议,请与本站联系,联系邮箱:thinkou@126.com,本站确认后将立即撤下。谢谢您的支持与理解!
相关评论