VBA代码,用于创建列出最近文档的Word功能区选项卡 [英] VBA code which creates a Word ribbon tab listing recent documents

查看:265
本文介绍了VBA代码,用于创建列出最近文档的Word功能区选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



是否有人看到任何VBA代码创建了一个列出最近文档的Word功能区选项卡?我发现文件选项卡下Backstage底部的最近文档列表距离太远,跳转列表中的文档列表太多移动目标。我在功能区定制中找不到
命令。



我在Google网上论坛上提出这个问题,微软MVP建议我来这里问问题。如果有一个更好的地方可以问这个告诉我,我真的不知道如何编码,但我有时能够修改其他人的代码,让它做我想要的b $ b。

Has anyone seen any VBA code which creates a Word ribbon tab listing recent documents? I find the recent document list at the bottom of Backstage under the File tab is too far away and the one in the jump list is too much of a moving target. I can't find a command in the ribbon customization which does it.

I asked this question on Google Groups and a Microsoft MVP suggested I come here and ask it. If there is a better place to ask this tell me, I really don't know how to code but I sometimes have been able to modify other people's code to get it to do what I want.

我最近从Word 2002升级了,我有一个菜单,它只是最近的文档列表。事实上,过去一个月我一直在使Word 2013的外观和行为与我十年来使用的Word一样多,自动隐藏功能区使其成为
更像菜单和加载我的快速访问带命令的工具栏。我甚至最近想出了如何编辑右键菜单,这似乎违背了微软的意愿。

I recently upgraded from Word 2002 where I had a menu which was nothing but the recent documents list. In fact, I have spent the past month making Word 2013 look and act as much as the Word I had been using for ten years, auto-hiding the ribbon to make it act more like menus and loading up my Quick Access toolbar with commands. I even recently figured out how to edit the right-click menu which seems to go against Microsoft’s wishes.

推荐答案

嗯,有一个 命令可以添加到你的QAT(或一个Ribbon选项卡)中;文件"选项类型/自定义功能区将直接带您进入最近文件列表(Backstage中的"打开"选项卡),默认情况下会列出最近的文件:
"打开"。这就是我使用的内容。在我看来,这就像"关闭"一样。如果您正在自动隐藏功能区,则将功能区中的按钮设置为...

Well, there's a command you can add to your QAT (or to a Ribbon tab) in the "File" category of Options/Customize Ribbon that will take you directly to the list of Recent files (the "Open" tab in the Backstage), where recent files are listed by default: "Open". That's what I use. It seems to me that's just as "close" as putting button in the Ribbon if you're auto-hiding the Ribbon...

可以使用VBA制作最近文件的列表,但您需要了解如何工作使用功能区XML,以便向功能区添加菜单,该菜单将显示如菜单的列表。这听起来并不像你曾经使用过的那样,但是,你可能想要首先查看三部分文档中的信息为开发人员自定义2007 Office Fluent功能区

It is possible to make a list of recent files using VBA, but you need to understand how to work with Ribbon XML in order to add a menu to your Ribbon that will display such a list as a menu. It doesn't sound like you've worked with that, yet, so you may want to first review the information in the 3-part documentation Customizing the 2007 Office Fluent Ribbon for Developers .

循环最近文件列表的基本代码,可以修改这些文件以与Ribbon XML一起生成菜单:

The basic code for looping the list of recent files that can be modified to generate a menu together with Ribbon XML:

Sub RecentFileList()
    Dim rf As RecentFile
    For Each rf In RecentFiles
        Debug.Print rf.path & "\" & rf.Name
    Next
End Sub

右键菜单:微软本身并不想要你改变它们。他们更多的是感觉到"随意的用户"。最终"弄得一团糟"如果太简单,那么支持必须帮助清理。自Office 2010以来,"正确"的方法是为上下文菜单定义
功能区XML。基本上,与定义作为加载项的一部分或与文档一起旅行的功能区的方式相同。 (与Office 2013提供的用于进行本地用户调整的工具相反,这可能是您正在使用的工具?)

Right-click menus: It's not that Microsoft doesn't want you changing them, per se. It's more that they feel "the casual user" ends up "making a mess" that support has to help clean up if it's too simple. Since Office 2010, the "correct" way is to define Ribbon XML for the context menues. Basically, the same way one defines a Ribbon that is part of an add-in or travels with a document. (As opposed to the tools Office 2013 provides for making local, user adjustments, which is probably what you're using?)


这篇关于VBA代码,用于创建列出最近文档的Word功能区选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆