출처 : 하루하나엑셀카페
출처 카페의 gogoyuijin님이 작성하신 사용자 정의 리본입니다.
첨부파일 다운 받아, 추가기능으로 등록하시면 사용하실 수 있습니다.
2007버전과 2010버전에서 테스트해본결과 둘 다 잘 되네요..
자주 사용되는 기능들을 잘 모아놓으셨네요..
나중에 제 스타일로 수정해서 사용해야겠습니다. ㅎㅎ
DownLoad : myxls.xlam
리본 편집기 소개..
http://www.ribboncreator.de/en/index.php?Download
[내용추가 : 2013.03.20]
Custom UI Editor말고 이걸 써보자.. Office Ribbon Editor v4.4.2
다운받기 : OfficeRibbonEditor442.exe
다운로드 사이트 : http://www.leafcreations.org/index.php/RibbonEditor/Mirrors
[ 내용추가:2012.02.15 ]
콜백(CallBack) 함수를 잘 정리한 사이트가 있어서 소개합니다.
Access의 RibbonX를 대상으로 하지만.. 콜백함수는 엑셀이나 엑세스나 같아서 참고하셔도 됩니다.
http://www.accessribbon.de/en/?Access_-_Ribbons:Callbacks
[내용추가:2010.12.24]
아래 사이트에 가보면, Controls나 imageMso를 쉽게 찾아볼 수 있는 파일을 공유하고 있다.
http://www.rondebruin.nl/ribbon.htm
Download the Excel 2007 version
Download the Excel 2010 version
그 외에도 리본의 image를 외부에서 불러오는 방법이나, 특정 파일에만 적용되는 QAT를 만드는 방법등을 설명해준다.
아래 페이지에서 제공되는 파일 중, Image5.xlsm를 열어보면 XML의 onLoad를 이용해서 Ribbon의 Status를 참조하는 방법이 있다.
http://www.rondebruin.nl/getimage.htm
<!-- in XML -->
<customUI onLoad="ribbonLoaded" xmlns="http://schemas.microsoft.com/office/2006/01/customui">
'### in Module
Option Explicit
Dim myRibbon As IRibbonUI
Dim PressedState As Boolean
'Callback for customUI.onLoad
Sub RibbonLoaded(ribbon As IRibbonUI)
Set myRibbon = ribbon
PressedState = False
End Sub
'Callback for customToggleButton1 onAction
Sub Macro1(control As IRibbonControl, pressed As Boolean)
Select Case pressed
Case True
PressedState = True
MsgBox "We turn the lights on"
Case False
PressedState = False
MsgBox "We turn the lights off"
End Select
myRibbon.InvalidateControl ("customToggleButton1")
End Sub
아래 방법을 응용하면 Label에 한글을 사용할 수 있을 것 같다. 굳이 XML에다가 넣지 않더라도 말이다.
<!-- in XML -->
<button id="customButton1" size="large" onAction="Macro1" getLabel="GetLabel" getImage="GetImage" />
<button id="customButton2" size="large" onAction="Macro2" getLabel="GetLabel" getImage="GetImage" />
'### In Module
Sub GetImage(control As IRibbonControl, ByRef image)
Select Case control.ID
Case "customButton1"
Set image = LoadPictureGDI(ThisWorkbook.Path & "\" & "Lighton.png")
Case "customButton2"
Set image = LoadPictureGDI(ThisWorkbook.Path & "\" & "Lightoff.png")
End Select
End Sub
Sub GetLabel(control As IRibbonControl, ByRef label)
Select Case control.ID
Case "customButton1"
label = "label 1"
Case "customButton2"
label = "label 2"
End Select
End Sub
[내용추가끝:2010.12.24]
[내용추가:2010.08.08]
1. 아래 링크를 가 보시면 정말~ 친절하고 쉽게 설명해주신 내용이 있습니다.
http://blog.naver.com/vfmercury/100094341342
(위 링크가 깨졌을 경우 : Excel2007_CustomRibbon_vfMercury.pdf )
2. 어떤 사이트를 참고해야하는지 쉽게 설명해주셨네요.
http://www.gosinga.net/archives/2525
3. MSDN에서 리본X에 대한 내용으로 Magazine을 발행한게 있네요.
http://msdn.microsoft.com/ko-kr/magazine/cc163410.aspx
[내용추가:2010.08.08 끝]
[내용추가:2010.08.12]
아래의 링크들도 참고해보세요.
1. 우노선생님이 재밌게 설명해주셨네요.. : http://www.uno21.com/admin/unosolution/xl2007_002.aspx
2. 권현욱님 사이트 : http://www.iexceller.com/MyXls/VBA_Beginner/Index_Beginner.asp
3. 구글에서 "Customizing the Ribbon"으로 조회한 결과 : http://www.google.co.kr/search?complete=1&hl=ko&q=Customizing+the+Ribbon&btnG=Google+%EA%B2%80%EC%83%89&aq=f&aqi=&aql=&oq=&gs_rfai=
4. The Office UI Bible.. 정말 바이블이라 할만큼 잘 정리되어 있습니다. 아쉽게도 영어.. =_=;;
http://pschmid.net/blog/2006/10/09/58
5. 버튼들의 종류 및 정렬 방법(영어) : http://blogs.msdn.com/b/jensenh/archive/2006/04/06/569876.aspx
6-1. 2007 Office System Add-In: Icons Gallery : 리본을 아이콘을 넣을때 이 갤러리를 사용하면 조금 더 편리하게 넣을 수 있습니다.
http://www.microsoft.com/downloads/details.aspx?FamilyID=12b99325-93e8-4ed4-8385-74d0f7661318&displaylang=en
http://www.excelguru.ca/blog/2007/02/
6-2. 오피스 2007에 사용되는 컨트롤 아이디 목록입니다. 깔끔하죠.. ㅎㅎ
다운받기 : 2007OfficeControlIDsExcel2007.EXE
7. RibbonX의 Controls 종류 :
button,toggleButton,editBox,menu,comboBox,dropDown,dialogBoxLauncher,gallery,splitButton,label,checkBox,group,tab,superTip
http://msdn.microsoft.com/ko-kr/magazine/cc163469.aspx (한국어)
http://msdn.microsoft.com/en-us/magazine/cc163469.aspx (영어)
8. 리본 메뉴 구성에 대한 기초적인 내용(영어) : http://www.rondebruin.nl/tips.htm
[내용추가:2010.08.12 끝]
아래.. RibbonX Reference 목록에 대한 출처 : http://pschmid.net/office2007/ribbonx/reference/index.php
RibbonX Reference
Top Microsoft Resources
Name | Content |
---|---|
MSDN Ribbon Portal | Microsoft Developer Network portal dedicated to Ribbon extensibility and RibbonX. |
Customizing the Office (2007) Ribbon User Interface (Part 1) | Overview of using RibbonX with Access, Excel, Outlook, PowerPoint and Word 2007 |
Customizing the Office (2007) Ribbon User Interface (Part 2) | RibbonX language reference |
Customizing the Office (2007) Ribbon User Interface (Part 3) | FAQs, Ribbon ID list, callback signatures for C#, C++, VBA and VB, attribute list with valid values |
Office 2007 Control ID List | idMsos for all elements of all default Microsoft Ribbons. |
RibbonX XML Schema | XML Schema that defines RibbonX. Very helpful, if you want to know what attributes and elements are permissible when. |
RibbonX Image FAQ | Everything you want to know about loading your own custom images via RibbonX |
Using RibbonX with C++ and ATL | RibbonX is fairly easy to use with a managed solution, but implementing it in unmanged C++ is not that simple. Great tutorial on how to do this! |
pschmid.net Resources
Name | Content |
---|---|
UI Style Guide | Everything you can do is not necessarily what you should do. Read my UI style guide to get a feeling for what you can do and how you should integrate your own solution/customization into the new Ribbon UI. |
imageMso List | Complete list of all 16x16 and 32x32 unique imageMso's in Office 2007 |
Other Microsoft Resources
Name | Content |
---|---|
Microsoft Office 2007 UI Style Guide | Explains how to best integrate your add-in into the new Ribbon UI. |
http://www.microsoft.com/downloads/details.aspx?FamilyID=12b99325-93e8-4ed4-8385-74d0f7661318&displaylang=en
What Others Are Downloading
Others who downloaded 2007 Office System Add-In: Icons Gallery also downloaded:
- 2007 Office System Document: Lists of Control IDs
- Office 2010 Add-In: Icons Gallery
- Access 2007 Download: Access Developer Extensions
- Access 2007 Download: Access Runtime
- Access 2007 Sample: Ribbon Extensibility in Access 2007
일단.. Custom UI Editor Tool을 다운 받으세요..
http://openxmldeveloper.org/archive/2006/05/26/CustomUIeditor.aspx
DownLoad : OfficeCustomUIEditorSetup.zip
==========================================================================================
[ 내용 추가 : 2010.12.14 ]
탭을 추가하기만 하면 되는 줄 알았더니..
Tabset이라는게 있더군요..
SmartArt, Table, PivotTable, Chart등을 선택시에만 표시되는 탭들입니다.
일반적으로는 아래와 같은 구조인데,
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="abTab">
<group id="abGroup">
<control id="abControl" />
</group>
</tab>
</tabs>
</ribbon>
여기에 tabset을 추가하려면 아래와 같은 구조가 됩니다.
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
<ribbon>
<tabs>
<tab id="abTab">
<group id="abGroup">
<control id="abControl" />
</group>
</tab>
</tabs>
<contextualTabs>
<tabSet idMso="TabSetTableToolsExcel">
<tab idMso="TabTableToolsDesignExcel">
<group id="abGroup">
<control id="abControl" />
</group>
</tab>
</tabSet>
</contextualTabs>
</ribbon>
자세한 내용은 아래 동영상을 참고하시기 바랍니다.
https://channel9vip.orcsweb.com/posts/jwiese/Adding-Tabs-to-a-TabSet-in-Office-2007-Apps/
( 동영상 직접 보기 링크 : mms://mschnlnine.wmod.llnwd.net/a1809/d1/ch9/3/7/7/3/4/4/CustomSets.wmv)