Forum Discussion
Microsoft Word 365 (16.0) Word Options - Customize Ribbon - Macros: List not sorted
Can anyone tell me why in Microsoft Word 365 (16.0) the list shown in Word Options - Customize Ribbon - Macros is not sorted?
I have an awful lot of macros and can't find the one I want to add to my ribbon just because the list is not sorted.
- Charles_KenyonBronze Contributor
I understand your frustration.
What is shown above is from my computer. The bulk of my macros are in different modules than the NewMacros module which is where recorded macros are stored.
By the way, my preference is to put macros on the QAT or assign them to a keyboard shortcut.
- Wim_KooyCopper Contributor
Hi Charles_Kenyon, thank you for your reply.
I put my macro's in a separate tab 'Custom tools' (image attached as well):
Then I export the ribbon and edit the XML to customize it (no icons, no autoresize).
I just wanted to add yet another macro to this tab, hence my question.
My macro's are in different modules as well, depending on their purpose.
From a developer's perspective I don't see why you shouldn't sort a list before filling the listbox.
Speed and/or memory shouldn't be an issue anymore these days.
- Charles_KenyonBronze Contributor
I agree that it should be sorted. That is why I included the feedback link.
Since you are already doing XML modifications, if you are creating special purpose Ribbon Tabs, you really should be doing it directly in XML following Greg Maxey's instructions. This gives much greater flexibility and power.
You do not want use the Customize the Ribbon tools in the UI and Export/Import. That really limits what you can do and means that to use it on another system, you need to overwrite any Ribbon or QAT modifications made by the user on that system already.
By modifying the XML of the template that contains your macros, you attach the modifications to that macro template and it can be used as a document or global template.Here is a screenshot from the Ribbon Tab I developed for my office.
The menus are primarily to create documents from templates and are completely dynamic. I can change the menu by adding or subtracting a template from a folder. You could put your macros into menus as well.
- Charles_KenyonBronze Contributor
One more thing... Macro Naming and organization.
I have thousands of macros and cannot remember the names. I mark most of them as "Private" so they do not even show up on my macro list. When I need to, I go into the vba Editor and use Find there to search through a project.
If I know it is in a certain module, I can use the drop-down list of procedures in the module, which is sorted alphabetically.
Generally when saving a macro, I never use the name suggested by Word, just as I never use that name when saving a Building Block. I will start the name with what it is I am trying to work on. I.e., Watermark, SectionBreak, Paragraph, Font, Style, etc. Then add a bit more about what the Macro does. I do not start macro names with things like Add, Delete, Change, etc. Doing this makes it easier to find macros when they are organized alphabetically.
If you add comments to your macros, the vba editor's Find can search them as well for keywords.
Macros should not be stored in the NewMacros module. That is, for me, simply a scratch workspace and I delete the module from time to time. Organizing your macros by Beth Melton, Word MVP
Macros that are really used in my day-to-day work are not stored in the Normal template at all but in various Global Templates. They are attached to ribbon buttons, QAT buttons, and keyboard shortcuts that are in the same template. QAT buttons and keyboard shortcuts can be created and saved in a template easily in the user interface, no need to go to XML. Most of the macros in my normal template are references, code that I have developed or stolen (with accreditation). I regularly back up my normal template because it seems that even on my own computer, bad things happen to it. This is even more so in corporate workspaces with IT departments that think they know better. Backup Normal.dotm template using a macro (That is one macro that I do store in and use from my Normal template.)