I am trying to create a VSTO Word Add-In to display some buttons in the ribbon, linked to templates stored on our file server.
I was adding the buttons to the Ribbon through the xml file.
<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui" onLoad="Ribbon_Load">
<ribbon>
<tabs>
<tab idMso="TabAddIns">
<group id="ContentGroup" label="YP Council Templates">
<button id="textButtonLetter" label="Letter"
screentip="Letter" onAction="OnTextButton"
supertip="Open the Letter Template."/>
<button id="textButtonMemorandym" label="Memorandum"
screentip="Memorandum" onAction="OnTextButton"
supertip="Open the Memorandum Template."/>
<button id="textButtonFacsimile" label="Facsimile"
screentip="Facsimile" onAction="OnTextButton"
supertip="Open the Facsimile Template."/>
<button id="textButtonPolicy" label="Policy Template"
screentip="Policy Template" onAction="OnTextButton"
supertip="Open the Policy Template."/>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Through the above code, I've successfully added the buttons in a group, but am wondering how I create the Action to open a Word Template file? Is it through a Macro, if so, where does the macro go? (NB - the onAction="OnTextButton" code is grabbed from a sample I was using)
The end goal, is that once the template file is opened (a new document based on the template), they should then use it as a basis for a new document.
Regards, Stewart