#16
|
|||
|
|||
Hi Charles. I am not using the Customise the ribbon dialog. The only reason was to get the name of the Style Manager which turned out to be a macro, not a command.
I have two issues: First is how to call the routine btnNewStyleSets_Click from the xml ribbon file so the style dialog will display Second is do I need to add the Sub btnNewStyleSets_Click(control As IRibbonControl) to the template vba, and what code do I put in that routine. I have read the QAT information links but I am still missing something. Please bear with me as a week ago I didn't even know there was xml behind the ribbon. |
#17
|
|||
|
|||
What problem are you having?
Is your button showing up in the Ribbon? Ribbon button or QAT icon? It makes a difference. Do you click on your button and nothing happens? |
#18
|
|||
|
|||
The button appears in the ribbon. Not using the QAT. This is the xml I am using.
<button id="Btn99" label="Style Menu" onAction="btnNewStyleSets_Click"/> When I click the button, nothing happens. What I don't understand is what the btnNewStyleSets_Click routine is. Is it some hidden built in procedure within Word, or do I have to write something in my VBA to display the dialog? I use VBA a lot in Access and understand if it was in Access, I would just create a button click procedure. Not sure if I have to create the procedure in Word, or if it is some embedded procedure. |
#19
|
|||
|
|||
It looks like btnNewStyleSets_Click is built into the Styles Pane. It is not a macro that is accessible by name. It is a part of the Style Pane and if a macro, is the equivalent of a private macro.
So, what you want is a button that displays the Manage Styles dialog? Last edited by Charles Kenyon; 04-23-2017 at 05:21 PM. |
#20
|
|||
|
|||
That sounds right. Any suggestion as to how to do this?
|
#21
|
|||
|
|||
Recommendation, for now, insert the command as a QAT button saved in your template. Perhaps later you will be able to do a Ribbon modification. Right now, I do not know how.
|
#22
|
|||
|
|||
The following command in a group will give you the button.
<button idMso="StylesManageStyles" visible="true" size="large"/> |
#23
|
|||
|
|||
Hi Charles
Think I am there now. Did a lot of research based on what you taught me and now use the following in the procedure. Application.Dialogs(wdDialogStyleManagement).Displ ay The style dialog I was using I suspect was from an addin called FSPro. It is a variation on the standard Word one above. The one above does all the same things, but not in such a visually appealing format. That had me confused for a long time. Anyway, the journey taught me a lot about ribbons so thank you for that. Hopefully my new ribbon will do all I want. |
#24
|
|||
|
|||
What I gave you was the XML to add a large button to the ribbon. That button would essentially launch the Style Management dialog, giving the same result as the code you found. The difference is that it uses the standard button from Word to do it. (I suspect that you already know this. I am commenting primarily to help someone who stumbles across this thread later.)
I gather that FSPro had its own dialog box (userform). |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Visio 2016 diagrams embeded in word 2016 not drawing properly | stubbo66 | Visio | 2 | 08-24-2016 05:58 PM |
Modifying RTF File in MS Word 2007 | Nickster | Word VBA | 2 | 12-02-2015 11:33 PM |
Modifying list styles in word | dreamz | Word | 1 | 06-30-2014 12:03 PM |
How to import the customized ribbon to Word without overwriting the existing Ribbon? | SharonSh | Word VBA | 0 | 09-26-2013 11:47 PM |
Modifying an existing table in Word | janewayb | Word Tables | 1 | 04-08-2013 06:17 PM |