none
Automatically install a macro with a toolbar button RRS feed

  • Question

  • I have written some macros for a friend, using Word 2010. I was careful to store the store the macros in the document (a MS Word 2003 template). I assigned the macros to buttons in a new group on the ribbon. After I had delivered the file, I realised that the macros were stored in the template (as I expected), but the ribbon changes were stored in Normal.dotm (not what I expected). I do not want to give my Normal template to the friend - it contains personal stuff and I do not want to overwrite any customisations he has.

    Is there a way to automate the creation of the buttons? My friend is non-technical and I do not want him to have to use the Customise feature. Also, I would like a consistent interface as the template may be shared further. It would be nice to have an installer that creates the macros and the buttons to use them.

    Thanks.

    Tuesday, May 28, 2013 2:46 PM

Answers

  • Hello,

    Office 2003 does not have a ribbon so the button on the ribbon cannot be stored.

    You can use a command button instead, this item is available for both Word 2003 and 2010.

    In Word 2010, go to Developer tab --> Controls group -->  Legacy Tools button --> ActiveX Controls --> Command Button. Then, a command button is added in the document. Double click on the command button, VBE will open and the "Private Sub CommandButton1_Click()" is already added.

    Regards,


    Damon Zheng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by PeterBill Thursday, May 30, 2013 8:15 PM
    Wednesday, May 29, 2013 11:26 AM
    Moderator

All replies

  • Hello,

    Office 2003 does not have a ribbon so the button on the ribbon cannot be stored.

    You can use a command button instead, this item is available for both Word 2003 and 2010.

    In Word 2010, go to Developer tab --> Controls group -->  Legacy Tools button --> ActiveX Controls --> Command Button. Then, a command button is added in the document. Double click on the command button, VBE will open and the "Private Sub CommandButton1_Click()" is already added.

    Regards,


    Damon Zheng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by PeterBill Thursday, May 30, 2013 8:15 PM
    Wednesday, May 29, 2013 11:26 AM
    Moderator
  • Thanks, Damon.

    It's not as neat as ribbon buttons, but it does the job.

    Thursday, May 30, 2013 8:16 PM