How to install word macro automatically?

yanlok1345
StarLounger
Posts: 63
Joined: 18 Oct 2023, 14:48

How to install word macro automatically?

Post by yanlok1345 »

Hi all,

I need to install a set of word macros in more than 20 computers. To install a module into the Microsoft Word, I need to first press Alt+F11, then input the module. After that, I need to customize the ribbon. There are 10 macros I need to customize, which means I need to do it 200 times.

Is there any word macros/other methods to auto-install the macros and auto set them on the ribbon of the Microsoft Word?

Many thanks for your help!

User avatar
HansV
Administrator
Posts: 77998
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: How to install word macro automatically?

Post by HansV »

Best wishes,
Hans

yanlok1345
StarLounger
Posts: 63
Joined: 18 Oct 2023, 14:48

Re: How to install word macro automatically?

Post by yanlok1345 »

Thank you for sharing this article to me! I now understand how difficult it is! :rofl:

User avatar
Charles Kenyon
4StarLounger
Posts: 594
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: How to install word macro automatically?

Post by Charles Kenyon »

It is not all that difficult. Feel free to ask followup questions.
Basic idea: put macros in a template.
Store that template in the Startup Folder for each computer. Then it becomes a global template and any macros in it are available in all documents or templates.

If you want it update-able, set it in a central location and have the centrally located file updated locally as part of a login procedure.

yanlok1345
StarLounger
Posts: 63
Joined: 18 Oct 2023, 14:48

Re: How to install word macro automatically?

Post by yanlok1345 »

Charles Kenyon wrote:
03 Jan 2024, 18:09
It is not all that difficult. Feel free to ask followup questions.
Basic idea: put macros in a template.
Store that template in the Startup Folder for each computer. Then it becomes a global template and any macros in it are available in all documents or templates.

If you want it update-able, set it in a central location and have the centrally located file updated locally as part of a login procedure.
Am I correct?

1. Should I place the macro code in "ThisDocument" within "Microsoft Visual Basic for Applications"?
2. Do I need to save that document as a .dotm file?
3. Should I put the .dotm file in the Startup Folder? Is it sufficient to save it only in the Startup Folder, or are there specific locations where it needs to be saved?

What I'm hoping for is:

I have to install a set of Word macros individually for multiple colleagues. This process is time-consuming because each colleague already has a different set of macros in the Word upper Ribbon. I'm wondering if there is a faster way to add a new group to the Word Ribbon, so I don't have to install the macros one by one. Is there a way to accomplish this?

User avatar
Charles Kenyon
4StarLounger
Posts: 594
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: How to install word macro automatically?

Post by Charles Kenyon »

yanlok1345 wrote:
12 Feb 2024, 15:40
Charles Kenyon wrote:
03 Jan 2024, 18:09
It is not all that difficult. Feel free to ask followup questions.
Basic idea: put macros in a template.
Store that template in the Startup Folder for each computer. Then it becomes a global template and any macros in it are available in all documents or templates.

If you want it update-able, set it in a central location and have the centrally located file updated locally as part of a login procedure.
Am I correct?

1. Should I place the macro code in "ThisDocument" within "Microsoft Visual Basic for Applications"?
It could be there, or in a standard or class module in your .dotm file.
2. Do I need to save that document as a .dotm file?
Yes
3. Should I put the .dotm file in the Startup Folder? Is it sufficient to save it only in the Startup Folder, or are there specific locations where it needs to be saved?
That is THE place to store it. Here are my writings on the Startup Folder and Global Templates:
https://addbalance.com/word/startup.htm#PageStart
https://www.addbalance.com/usersguide/t ... htm#Global

What I'm hoping for is:

I have to install a set of Word macros individually for multiple colleagues. This process is time-consuming because each colleague already has a different set of macros in the Word upper Ribbon. I'm wondering if there is a faster way to add a new group to the Word Ribbon, so I don't have to install the macros one by one. Is there a way to accomplish this?
Yes. You can do this. I have done it.
I modify both the Ribbon and the QAT as well as add keyboard shortcuts. QAT modifications and Keyboard shortcuts are much easier and can be done within the user interface. Ribbon modification requires working with XML.
https://addbalance.com/word/QATmodifica ... #PageStart
https://answers.microsoft.com/en-us/mso ... 5883735330

See my responses to this question to get started.
https://stackoverflow.com/questions/779 ... bon-button
This is not a small undertaking.

Start with "Modify the Ribbon - It Doesn't Take Rocket Science" by Greg Maxey. https://gregmaxey.com/word_tip_pages/cu ... _main.html This is XML programming combined with vba. Good technical specs on the commands, start with Ribbon X which is an older book but still applicable. https://web.archive.org/web/20180417112 ... n.2008.pdf.

Here are a few of my Add-Ins that have ribbon modifications done through XML. You are welcome to look at them. https://addbalance.com/word/download.htm#FileNewClassic, https://addbalance.com/word/download.htm#GenderToolbar, https://addbalance.com/word/download.ht ... eNumbering, https://addbalance.com/word/download.htm#ChrisWoodman - - Read Greg Maxey's page before you try to figure out how these work, though.

User avatar
Charles Kenyon
4StarLounger
Posts: 594
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: How to install word macro automatically?

Post by Charles Kenyon »

Afterthoughts...
A global template is, in my opinion, the key way to implement changes to the Word interface that are as nonintrusive as possible. It is far better than mandating the Normal.dotm template or overwriting user customizations. I earlier gave a link to my writing about these templates. They can accomplish tremendous things.
Another thing you can and should store in global templates are Building Blocks/Autotext to be shared.

Do read the original thread that Hans linked as well.

yanlok1345
StarLounger
Posts: 63
Joined: 18 Oct 2023, 14:48

Re: How to install word macro automatically?

Post by yanlok1345 »

Charles Kenyon wrote:
13 Feb 2024, 04:10
yanlok1345 wrote:
12 Feb 2024, 15:40
Charles Kenyon wrote:
03 Jan 2024, 18:09
It is not all that difficult. Feel free to ask followup questions.
Basic idea: put macros in a template.
Store that template in the Startup Folder for each computer. Then it becomes a global template and any macros in it are available in all documents or templates.

If you want it update-able, set it in a central location and have the centrally located file updated locally as part of a login procedure.
Am I correct?

1. Should I place the macro code in "ThisDocument" within "Microsoft Visual Basic for Applications"?
It could be there, or in a standard or class module in your .dotm file.
2. Do I need to save that document as a .dotm file?
Yes
3. Should I put the .dotm file in the Startup Folder? Is it sufficient to save it only in the Startup Folder, or are there specific locations where it needs to be saved?
That is THE place to store it. Here are my writings on the Startup Folder and Global Templates:
https://addbalance.com/word/startup.htm#PageStart
https://www.addbalance.com/usersguide/t ... htm#Global

What I'm hoping for is:

I have to install a set of Word macros individually for multiple colleagues. This process is time-consuming because each colleague already has a different set of macros in the Word upper Ribbon. I'm wondering if there is a faster way to add a new group to the Word Ribbon, so I don't have to install the macros one by one. Is there a way to accomplish this?
Yes. You can do this. I have done it.
I modify both the Ribbon and the QAT as well as add keyboard shortcuts. QAT modifications and Keyboard shortcuts are much easier and can be done within the user interface. Ribbon modification requires working with XML.
https://addbalance.com/word/QATmodifica ... #PageStart
https://answers.microsoft.com/en-us/mso ... 5883735330

See my responses to this question to get started.
https://stackoverflow.com/questions/779 ... bon-button
This is not a small undertaking.

Start with "Modify the Ribbon - It Doesn't Take Rocket Science" by Greg Maxey. https://gregmaxey.com/word_tip_pages/cu ... _main.html This is XML programming combined with vba. Good technical specs on the commands, start with Ribbon X which is an older book but still applicable. https://web.archive.org/web/20180417112 ... n.2008.pdf.

Here are a few of my Add-Ins that have ribbon modifications done through XML. You are welcome to look at them. https://addbalance.com/word/download.htm#FileNewClassic, https://addbalance.com/word/download.htm#GenderToolbar, https://addbalance.com/word/download.ht ... eNumbering, https://addbalance.com/word/download.htm#ChrisWoodman - - Read Greg Maxey's page before you try to figure out how these work, though.
Thank you for taking the time to provide such a detailed response. Your input is greatly appreciated. I will conduct thorough research on the information you have provided to ensure I have a complete understanding of the matter.

Once again, thank you for your kind assistance.