国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 辦公 > Excel > 正文

Excel2007 RibbonX使用教程

2024-08-23 19:52:16
字體:
來源:轉載
供稿:網友

在制作自己的選項卡中,我們可以利用Office2007Custom UI Editor工具來幫助我們完成工作。但,如果您沒有此工具,別擔心,我們還可以利用WinRAR軟件來達到我們的目的。
雖然,Excel2007自帶的Excel 2007 開發人員參考幫助中也有介紹到此方法,卻不是在Excel里可以直接應用的,且不夠詳盡,在此,我將制作過程拆解,一一為您奉上。

Step1:

建立一文本文件,寫入下列xml代碼:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="CustomTab" label="My Tab">
<group id="SampleGroup" label="Company Name">
<button id="Button" label="Insert Company Name" size="large"/>
</group >
</tab>
</tabs>
</ribbon>
</customUI>

(注意:Insert Company Name按鈕的OnAction代碼執行名InsertCompanyName,必須與將要建立的RibbonSample.xlsm中的回調過程名一致。)

另存擴展名為XML的customUI.xml文件(注意:必須是此文件名)。
新建一customUI文件夾,將此文件放入customUI文件夾里(注意:必須是此文件夾名)。

Step2:
新建一xlsm(啟用宏)文件,命名為“RibbonSample.xlsm”
插入一標準模塊,寫入下列代碼:(如圖1所示)

Sub InsertCompanyName(ByVal control As IRibbonControl)
Dim MyText As String

If TypeName(Selection) <> "Range" Then Exit Sub
MyText = "Microsoft Corporation"
Selection.Value = MyText
End Sub

Excel2007 RibbonX使用教程 CUOxin.COM教程

(圖1)

關閉并保存此工作簿。


Step3:
將RibbonSample.xlsm 重命名為 RibbonSample.xlsm.zip 文件。
雙擊此zip文件(無需關閉zip文件),我們會看到zip容器中包含一名為_rels的文件夾(如圖2所示),將此文件夾解壓縮到桌面上。

圖2.JPG

(圖2)

以記事本打開方式,打開桌面上_rels文件夾中的.rels XML文件。
內容如下:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-PRoperties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>


為了和此前建立的customUI.xml文件建立聯系,將如下XML語句,

<Relationship Id="someID" Type="http://schemas.microsoft.com/office/2006/relationships/ui/extensibility" Target="customUI/customUI.xml" />

(注意,ID可以是任意的,但不能重復。Target就是先前我們建立的customUI文件夾和文件。)

插入到</Relationships>之前:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>
<Relationship Id="someID" Type="http://schemas.microsoft.com/office/2006/relationships/ui/extensibility" Target="customUI/customUI.xml" />
</Relationships>

退出并保存此XML文件。

將此_rels文件夾(包含剛修改的.rels文件)替換zip文件容器中的_rels文件夾。

Step4:

將前面已經準備好的customUI文件夾,放入此zip容器(如圖3所示)。

圖3.JPG

(圖3)

關閉zip文件,將其改名為原來的RibbonSample.xlsm文件名。


Step5:

雙擊打開RibbonSample.xlsm文件,啟用宏,我們將在功能區(RibbonX)用戶界面中看到一個My Tab的自定義選項卡(如圖4所示)。

單擊該選項卡,我們會看到一個帶有按鈕控件的Company Name的組。

單擊Inset Company Name按鈕,可在選定的單元格中插入Microsoft Corporation字樣。

圖4.JPG

(圖4)

到此,我們的自定義選項卡就已經大功告成。


上一篇:制作Excel斜表頭

下一篇:excel2007中的宏

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 彭阳县| 中卫市| 阿瓦提县| 巢湖市| 孝义市| 丁青县| 将乐县| 乐都县| 孝感市| 新巴尔虎右旗| 慈溪市| 古田县| 右玉县| 隆德县| 左云县| 朝阳市| 桦甸市| 杭州市| 湖南省| 马关县| 陆河县| 象山县| 尼玛县| 年辖:市辖区| 富民县| 登封市| 旅游| 城口县| 合江县| 耒阳市| 山东| 新和县| 镇平县| 琼结县| 富源县| 绥滨县| 怀宁县| 香港 | 铜梁县| 喀什市| 舞阳县|