ExcelHome技术论坛

 找回密码
 免费注册

QQ登录

只需一步,快速开始

快捷登录

搜索
EH技术汇-专业的职场技能充电站 妙哉!函数段子手趣味讲函数 Excel服务器-会Excel,做管理系统 Excel Home精品图文教程库
HR薪酬管理数字化实战 Excel 2021函数公式学习大典 Excel数据透视表实战秘技 打造核心竞争力的职场宝典
300集Office 2010微视频教程 数据工作者的案头书 免费直播课集锦 ExcelHome出品 - VBA代码宝免费下载
用ChatGPT与VBA一键搞定Excel WPS表格从入门到精通 Excel VBA经典代码实践指南
查看: 20639|回复: 18

XLL加载宏-使用ExcelDna开发的自定义Ribbon的例子及资料

  [复制链接]

TA的精华主题

TA的得分主题

发表于 2013-6-8 00:30 | 显示全部楼层 |阅读模式
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件       ★免费下载 ★       ★ 使用帮助
本帖已被收录到知识树中,索引项:插件开发
本帖最后由 liucqa 于 2014-2-11 19:22 编辑

Ribbon.rar (927.62 KB, 下载次数: 1444)

捕获.JPG

包括如下演示:
1、隐藏插入选项卡
2、禁止文件打开、关闭、保存菜单功能
3、自定义选项卡包括:
     1)、多级菜单
     2)、动态多级菜单(回调实现)的桌面文件列表功能
     3)、动态修改Button文字和图片(回调实现)
4、加载宏

实际功能只写了加载宏和桌面文件列表的动态菜单演示功能,子目录最大深度4级。


自定义的customUI如下:
[code=sql]<customUI xmlns='http://schemas.microsoft.com/office/2006/01/customui' loadImage='LoadImage'  onLoad='ribbonLoaded'>   
  <commands>  
    <command idMso="FileOpen" getEnabled="rxshared_setDisabled"/>  
    <command idMso="FileClose" getEnabled="rxshared_setDisabled"/>  
    <command idMso="FileExit" getEnabled="rxshared_setDisabled"/>  
    <command idMso="FileSave"/>  
  </commands>  
  <ribbon startFromScratch="false">
    <tabs>
       <tab idMso="TabInsert" visible="false" />
       <tab id='CustomTab' label='动态选项卡' insertAfterMso="TabHome">
          <group id='SampleGroup' label='第一组'>  
             <menu id="rxMenu" label="多级菜单" imageMso="ReviewCompareMenu" size="large">
                <menu id="subMenu1" label="SubMenu1">
                   <menu id="subMenu11" label="3-SubMenu1">
                      <button id="rxMenu11" label="Up" imageMso="OutlineMoveUp" />
                      <button id="rxMenu12" label="GoTo" imageMso="GoTo" />
                      <button id="rxMenu13" label="Down" imageMso="OutlineMoveDown" />
                   </menu>
                </menu>
                <menu id="subMenu2" label="SubMenu2">
                   <menu id="subMenu21" label="3-SubMenu2">
                      <button id="rxMenu21" label="Up" imageMso="OutlineMoveUp" />
                      <button id="rxMenu22" label="GoTo" imageMso="GoTo" />
                      <button id="rxMenu23" label="Down" imageMso="OutlineMoveDown" />
                   </menu>
                </menu>
                <menuSeparator id="MySeparator" />
                <button id="rxMenuButton" label="Button" />
             </menu>  
            <separator id="separator1" />              
            <dynamicMenu id="FileManager" label="桌面文件" imageMso="CreateReportFromWizard"  size="normal" getContent="MenuContent"/>
            <button id='Button1' label='Button1' image='M' size='normal' onAction='RunTagMacro' tag='ShowHelloMessage' />
            <button id='Button2' label='Button2' image='M' size='normal' onAction='OnButtonPressed'/>
            <separator id="separator2" />
            <button id='Button3' getImage='Button_getImage' getLabel='Button_getLabel' size='normal' onAction='Button3_Click' screentip="This is the screentip of button3" supertip="This is the supertip of button3"/>
          </group >
       </tab>
    </tabs>
  </ribbon>
</customUI>[/code]

回调函数请自己写


本帖主要作用是保留资料链接,请勿跟帖,谢谢

评分

4

查看全部评分

TA的精华主题

TA的得分主题

 楼主| 发表于 2013-6-8 09:09 | 显示全部楼层
本帖最后由 liucqa 于 2013-10-29 11:34 编辑

http://msdn.microsoft.com/zh-cn/office/aa905530.aspx
Office Fluent 用户界面、功能区和 Backstage 视图

http://msdn.microsoft.com/zh-cn/library/aa338202.aspx
http://msdn.microsoft.com/en-us/library/aa338199.aspx
http://msdn.microsoft.com/en-us/library/aa722523.aspx
自定义 2007 Office Fluent 功能区(针对开发人员,第 1 部分,共 3 部分)  Customizing the 2007 Office Fluent Ribbon for Developers

http://www.excelperfect.com/index.php/2009/05/21/ribbonxstudy9/
细品RibbonX(9):层次分明的RibbonX代码结构

http://msdn.microsoft.com/zh-cn/office/hh128771
使用 Visual Studio 创建的 Excel 解决方案

http://msdn.microsoft.com/zh-cn/library/office/ee691833%28v=office.14%29.aspx
针对开发人员的 Office 2010 Backstage 视图介绍(回调函数说明)

http://msdn.microsoft.com/zh-cn/library/office/ff645396%28v=office.14%29.aspx
动态更改 Office 2010 Backstage 视图中组和控件的可见性
269519.jpg

http://msdn.microsoft.com/zh-cn/library/office/ee815851%28v=office.14%29.aspx
为开发人员自定义 Office 2010 Backstage 视图

http://msdn.microsoft.com/zh-cn/library/office/ee704588%28v=office.14%29.aspx
同时面向 2007 版本和 2010 版本的 Microsoft Office 用户界面解决方案

http://msdn.microsoft.com/zh-cn/library/office/ee691834%28v=office.14%29.aspx
Office 2010 中的功能区扩展性:选项卡激活和自动缩放

http://msdn.microsoft.com/en-us/library/ee691832(v=office.14).aspx
Customizing Context Menus in Office 2010

http://technet.microsoft.com/zh-cn/library/cc179143
禁用 Office 2010 中的用户界面项和快捷键(使用组策略)

http://msdn.microsoft.com/zh-cn/ ... v=office.14%29.aspx
Office 2010 中面向开发人员的新增功能

http://msdn.microsoft.com/zh-cn/office/aa905411.aspx
面向开发者的门户,查找 Microsoft Excel 2013、Excel 2010 和 Excel 2007 的开发人员资源和培训。

http://msdn.microsoft.com/zh-cn/magazine/cc163469.aspx
RibbonX API: 利用您自己的功能区选项卡和控件扩展 2007 Office System


******************************************************************************************************

http://www.rondebruin.nl/win/section2.htm
Ribbon and Quick Access Toolbar(QAT) pages


Load different RibbonX when opening file in Excel 2007 or 2010/2013
http://www.rondebruin.nl/win/s2/win002.htm

http://www.rondebruin.nl/win/s2/win003.htm
Ribbon Examples files and Tips

http://www.rondebruin.nl/win/s2/win004.htm
Menu for favorite macros in Quick Access Toolbar in Excel 2007-2013

http://www.rondebruin.nl/win/s2/win005.htm
How do I change Backstage(File) view in Excel 2010-2013

http://www.rondebruin.nl/win/s2/win006.htm
Customize Contextual tabs in Excel 2007-2013

http://www.rondebruin.nl/win/s2/win007.htm
Add missing built-in commands to the QAT or Ribbon

http://www.rondebruin.nl/win/s2/win008.htm
Customize the images in the Quick Access Toolbar

http://www.rondebruin.nl/win/s2/win009.htm
Images on Custom Ribbon controls in Excel 2007-2013

*****************************************************************************

http://www.tushar-mehta.com/publish_train/xl_vba_cases/1017%20Save%20a%20global%20in%20an%20Excel%20workbook.shtml
Save a global variable in an Excel workbook

http://www.tushar-mehta.com/publish_train/xl_vba_cases/1018%20Protect%20a%20global%20variable%20in%20another%20VBProject.shtml
Protect a global variable in another VB project

TA的精华主题

TA的得分主题

 楼主| 发表于 2013-6-8 14:57 | 显示全部楼层
本帖最后由 liucqa 于 2013-6-8 15:01 编辑

http://fluent.codeplex.com/
Fluent Ribbon Control Suite
Fluent Ribbon Control Suite is a library that implements an Office-like (Microsoft&#174; Office Fluent&#8482; user interface) for the Windows Presentation Foundation (WPF). It provides well-customized controls such as RibbonTabControl, Backstage, Gallery, QuickAccessToolbar, ScreenTip and so on. It is bundled with the most up-to-date Office 2010 styles.

wpf开发


Fluent.png

TA的精华主题

TA的得分主题

 楼主| 发表于 2013-6-9 15:15 | 显示全部楼层
本帖最后由 liucqa 于 2013-10-29 11:51 编辑

http://www.microsoft.com/en-us/download/details.aspx?id=36798
http://www.microsoft.com/en-us/download/details.aspx?id=727   
office 2013 controls idMso imageMso.rar (117.21 KB, 下载次数: 113)       Office 2013 idMso & imageMso documentation
office 2013 controls idMso imageMso.rar (117.21 KB, 下载次数: 69) (暂无2013 Icons Gallery)

http://www.microsoft.com/en-us/download/details.aspx?id=3582
http://www.microsoft.com/en-us/download/details.aspx?id=11675
office 2007 idMso imageMso.rar (136.16 KB, 下载次数: 76)      Office2007IconsGallery,ExcelRibbonControls

http://www.microsoft.com/en-us/download/details.aspx?id=6627
http://www.microsoft.com/en-us/download/details.aspx?id=21103
office 2010idMso imageMso.rar (251.57 KB, 下载次数: 96)


http://msdn.microsoft.com/en-us/library/cc313070(v=office.12).aspx
[MS-CUSTOMUI] PDF.


http://msdn.microsoft.com/en-us/library/dd909370(v=office.12).aspx
[MS-CUSTOMUI2]: Custom UI XML Markup Version 2 Specification

http://soltechs.net/CustomUI/imageMso01.asp
可以查看idMso的名称及图片

http://www.rondebruin.nl/win/section2.htm
Ribbon and Quick Access Toolbar(QAT) pages


http://msdn.microsoft.com/en-us/library/dd923396%28v=office.12%29.aspx
2.1.1 Ribbon and Backstage Customizations
This topic has not yet been rated

Content type  application/xml

Root namespace:   
http://schemas.microsoft.com/office/2009/07/customui

Source relationship:
http://schemas.microsoft.com/office/2007/relationships/ui/extensibility

An instance of this part specifies ribbon and Backstage customizations. A package is permitted to contain at most one ribbon and Backstage Customizations part, and each part MUST be the target of an explicit relationship from the root package, as specified in [ISO/IEC29500-1:2011] section 9.2.

A ribbon and Backstage Customizations part is permitted to contain explicit relationships to Image Parts, as specified in [ISO/IEC29500-1:2011] section 15.2.14.
The syntax of the structures contained in this part uses XML schema definition (XSD), as specified in [XMLSCHEMA1] and [XMLSCHEMA2].
This specification defines and references various XML namespaces by using the mechanisms specified in [XMLNS].
The content of the part is XML. The root element for the part is the customUI element, as specified in section 2.2.1.

http://standards.iso.org/ittf/PubliclyAvailableStandards/index.html
ISO/IEC 29500-1:2012

TA的精华主题

TA的得分主题

 楼主| 发表于 2013-6-23 14:44 | 显示全部楼层
本帖最后由 liucqa 于 2013-6-23 14:47 编辑

http://msdn.microsoft.com/zh-cn/ ... v=office.12%29.aspx   Office 2007
2007 Microsoft Office 套件技术文章
Outlook 2007 中的代码安全性变化
Word 2007 中针对开发人员的新增功能
使用 Visual Studio Tools for Office 创建自定义任务窗格
创建 Office (2007) 自定义任务窗格
在 Excel 2007 中开发加载项 (XLL)
在自定义 Web 窗体中托管 InfoPath 2007 窗体编辑环境
将 OneNote 2007 与文档管理系统集成
将文档级自定义迁移到应用程序级加载项
开发 InfoPath 表单的安全指导原则
用于将 InfoPath 2007 集成到 Visual Studio 2005 中的 InfoPath Designer API 概述
自定义适用于开发人员的 Office (2007) 功能区用户界面
针对开发人员的 Windows SharePoint Services V3 和 SharePoint Server 2007 工作流简介

http://msdn.microsoft.com/zh-cn/library/aa730920.aspx

在 Excel 2007 中开发加载项 (XLL)


使用 COM 加载项自定义功能区 UI 如果在应用程序级别进行自定义,无论打开哪一个文档,所产生的修改过的功能区 UI 都会出现在应用程序中。首先,需要创建 COM 加载项来进行这些修改。
使用 COM 加载项自定义功能区 UI
  • 创建一个 COM 加载项项目。
    所创建的加载项必须实现 Extensibility.IDTExtensibility2 接口(所有 COM 加载项都须如此),还必须实现附加 IRibbonExtensibility 接口(位于 Microsoft.Office.Core 名称空间中)。
  • 构建加载项并设置项目,然后安装项目。
  • 启动 Microsoft Office 应用程序。
    加载项加载后,将触发 IDTExtensibility2::OnConnection 事件,与在先前版本的 Office 中一样,该事件会将加载项初始化。
  • 接下来将调用 QueryInterface 方法,它确定是否实现了 IRibbonExtensibility 接口。
  • 如果已实现,将调用 IRibbonExtensibility::GetCustomUI 方法,该方法加载 XML 标记(从 XML 自定义文件或从过程中内嵌的 XML 标记),然后将自定义功能区 UI 加载到应用程序中。
  • 最后,用户将可以开始使用自定义功能区 UI。


TA的精华主题

TA的得分主题

发表于 2013-6-25 15:59 | 显示全部楼层

TA的精华主题

TA的得分主题

 楼主| 发表于 2013-6-28 00:00 | 显示全部楼层

TA的精华主题

TA的得分主题

 楼主| 发表于 2013-6-28 00:39 | 显示全部楼层
本帖最后由 liucqa 于 2016-6-18 12:56 编辑

http://support.microsoft.com/kb/302901/zh-cn
HOW TO:使用 Visual C# .NET 生成 Office COM 外接程序

http://msdn.microsoft.com/zh-cn/library/aa289518(v=vs.71).aspx
Tips and Tricks: Building Microsoft Office Add-ins with Visual C# .NET and Visual Basic .NET

http://www.koushuiniu.com/devtec/n19440/
office addin csharp(c#)开发,示例详解

http://blog.csdn.net/snlei/article/details/2188100
用.NET建立Office Add-in


http://blog.csdn.net/wilsonke/article/details/8694226
Deploying COM Add-ins for 64-bit Office using Visual Studio (Saaid Khan for Nathan Halstead)


http://www.time4tea.net/wiki/display/MAIN/Writing+an+Excel+COM+AddIn
Writing an Excel COM AddIn


http://msdn.microsoft.com/zh-cn/library/tzat5yw6(v=vs.71).aspx
Assembly Registration Tool (Regasm.exe) 参数
https://social.msdn.microsoft.co ... forum=officegeneral
Information on the Office Fluent UI (Ribbon) for Developers


TA的精华主题

TA的得分主题

 楼主| 发表于 2013-7-29 14:32 | 显示全部楼层
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用  · 内置多项VBA编程加强工具       ★ 免费下载 ★      ★使用手册
本帖最后由 liucqa 于 2014-4-9 23:36 编辑

http://www.cnblogs.com/yangecnu/ ... t-Introduction.html

四 Excel开发的资源

本文及后面的文章主要介绍ShardAddin和VSTO开发,所以下面列出我所看过的觉得有用的一些资源:

1.MSDN 论坛相应的模块:

    MSDN VSTO 论坛 http://social.msdn.microsoft.com ... -US/home?forum=vsto
    MSDN Excel Programming http://social.msdn.microsoft.com/Forums/en-US/exceldev/threads
    MSDN Apps for Office http://social.msdn.microsoft.com ... forum=appsforoffice

2.博客

    Cindy Meister 大神博客 http://blogs.msmvps.com/wordmeister
    Calvin Gao 小神博客 http://social.msdn.microsoft.com/Profile/calvin_gao/activity
    MYM]Brooks同学博客 http://www.cnblogs.com/brooks-dotnet/category/233027.html

3.书籍

    VSTO开发相关书籍推荐 Visual Studio Tools for Office 2007: VSTO for Excel, Word, and Outlook
    XLL开发书籍 Financial Applications using Excel Add-in Development in C / C++


http://www.cnblogs.com/yangecnu/p/3267070.html
浅谈Excel开发:四 Excel 自定义函数

http://www.cnblogs.com/yangecnu/p/3506377.html
浅谈Excel开发:十 Excel 开发中与线程相关的若干问题

TA的精华主题

TA的得分主题

发表于 2013-9-13 07:06 | 显示全部楼层
您需要登录后才可以回帖 登录 | 免费注册

本版积分规则

关闭

最新热点上一条 /1 下一条

手机版|关于我们|联系我们|ExcelHome

GMT+8, 2024-4-25 18:37 , Processed in 0.048163 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 1999-2023 Wooffice Inc.

沪公网安备 31011702000001号 沪ICP备11019229号-2

本论坛言论纯属发表者个人意见,任何违反国家相关法律的言论,本站将协助国家相关部门追究发言者责任!     本站特聘法律顾问:李志群律师

快速回复 返回顶部 返回列表