I have done some quite extensive customisation to the Office 2010 ribbon in Microsoft Word, using a combination of XML, VBA - using the Custom UI Editor.
What I'm trying to establish is that if it's possible to add a button to the ribbon based on if there is a certain string found in the current file name. For example:
- If fileName contains "PM" (probably using the InStr method)
- Add button to ribbon
Any pointers, examples or articles would be much appreciated. I've done some digging but haven't been able to find an appropriate method yet.
I was hoping to use the Onload attribute in the XML to fire the relevant sub that detects the filename and manipulates the ribbon accordingly.
Many thanks in advance.