4specs.com    4specs.com Home Page

Sharing macros in MS Word? Log Out | Topics | Search
Moderators | Register | Edit Profile

4specs Discussion Forum » Computers, the Internet and Networking » Sharing macros in MS Word? « Previous Next »

  Thread Last Poster Posts Pages Last Post
  Start New Thread        

Author Message
David Axt, AIA, CCS, CSI
Junior Member
Username: David_axt

Post Number: 99
Registered: 03-2002
Posted on Monday, March 10, 2003 - 07:57 pm:   Edit PostDelete PostPrint Post

With Microsoft Word, how do I share a macros with my fellow workers?

One of the nice features of WordPerfect was the separate marco files.
David E Lorenzini
New member
Username: Deloren

Post Number: 11
Registered: 04-2000
Posted on Monday, March 10, 2003 - 08:41 pm:   Edit PostDelete PostPrint Post

Macros are units of text between Sub and End Sub statements. Open Visual Basic Editor (Alt-F11), find the macro, select, then copy and paste in Notepad (to attach) or in an email message. The person receiving the macro copies and pastes it in their VB Editor. They would then have to know how to create a tool bar button or a keyboard shortcut. Here's a simple macro to replace double returns with singles:

Sub RemEmptyParagraphs()
'
' RemoveEmptyParagraphs Macro
' Starts from any point
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p^p"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

The actual macro appears with the proper indents, but is flattened out by this discussion editor.
Doug Frank CSI CCS
New member
Username: Doug_frank_ccs

Post Number: 25
Registered: 06-2002
Posted on Tuesday, March 11, 2003 - 08:21 am:   Edit PostDelete PostPrint Post

Macros in Word are stored in your "normal.dot" file that is loaded each time you start Word. We have created a separate file here called "fkp.dot" that is stored on our network. We can update fkp.dot by adding and modifying macros and other neat stuff, then share those with all users by having everyone's computer load fkp.dot along with their personal normal.dot

Don't ask me exactly how it works. I create many of the macros, but our IT guys make it available to others over the network.
John Bunzick, CCS, CCCA
New member
Username: Bunzick

Post Number: 70
Registered: 03-2002
Posted on Tuesday, March 11, 2003 - 08:45 am:   Edit PostDelete PostPrint Post

Macros can also be stored in any word document. When creating the macro, you have a choice of where to save it, and can select the open document. You can cut-and-paste macro code as described above directly into another document's macro store as well. You have to have the document opened, and the VBA editor to do that.

An easier way is use the Organizer. The organizer moves macros, styles, and toolbars from one file to another. The simplest way to get to the organizer is to go to Format>Styles then click the Organizer button. (yes, I know we're talking about macros - just trust me!) From there, select the Macro Project Organizer tab. You can then select the source and target files for copying the macros. Note that Word defaults to the .dot extension, so if you have the macro in a regular document (.doc), you need to change the file type selector.

Once you have a macro in a document, you can merely open the document to have access to the macro.

Another way to have access to macros is to put the template in a well-identified place on the company network. You can then "load" the template using Tools>Templates and add-ins. All the macros and toolbars in that template will then be available for that session. Every document opened will then have access to the macros in that template.

If you have any other Word questions, or need more help with any of these features, please let me know. I have built up a fair knowledge of MS Word over the years and would be happy to share it.
Anonymous
 
Posted on Monday, January 26, 2004 - 04:55 pm:   Edit PostDelete PostPrint Post

If I want to share a WordPerfect macro with anyone, I just send 'em the file. No cut-and-paste, no IT guy required, no opening an editor.
Anonymous
 
Posted on Saturday, April 28, 2007 - 10:29 am:   Edit PostDelete PostPrint Post

CORRECTION:
Macros are NOT ALWAYS stored in your normal.dot file. They are stored wherever you tell Word to store them. When you create a new macro, a dialog box allows you to save the macro globally in normal.dot or to save it only in the file. If oyu save it only in the file, it is not stored in normal.dot.
Chris Grimm, CSI, CCS, MAI, RLA
Senior Member
Username: tsugaguy

Post Number: 75
Registered: 06-2005
Posted on Tuesday, May 15, 2007 - 10:34 pm:   Edit PostDelete PostPrint Post

John, or anyone,
If a Word template w/ macros that needs to be shared via company network is stored in a location that is indicated in the workgroup templates path in tools / options / file locations, will that allow for centrallized code management of macro programs? would that be used instead of or somehow in addition to the templates & add-ins method? And what happens if a user has a macro with same name in their normal template as one of the macros in the workgroup template?
David E Lorenzini
Senior Member
Username: deloren

Post Number: 67
Registered: 04-2000
Posted on Wednesday, May 16, 2007 - 12:12 am:   Edit PostDelete PostPrint Post

Chris, I don't have experience with workgroup templates, but the answer to the last part of your question is that you can have macros with the same name in each template. When you attach a custom template to your document, the macro in the custom template takes precedence over the one with the same name in normal.dot. I think of the custom template as a layer over the normal template.

Using custom templates for specific types of documents have a lot of advantages and keep the size of the normal.dot smaller. When you set up your tool bar buttons or keycode shortcuts, you have to remember to select the correct template when choosing the macro that is applied.

There should not be a problem with a mix up in template usage, since each document that you attach a custom template to will "lock in" the settings and will remember where the template is stored so it can access the macros.
John Bunzick, CCS, CCCA
Senior Member
Username: bunzick

Post Number: 715
Registered: 03-2002
Posted on Wednesday, May 16, 2007 - 09:40 am:   Edit PostDelete PostPrint Post

Chris,
Locating a template in the workgroup templates path will make it available as a source for new documents when selecting the File > New command. The macros that are in the template will then be embedded (copied) in the file you create from that template. Thus, they are available while editing that document. However, this can lead to increased file sizes, and revisions to the template will not be reflected in the existing document. You can set up automatic updating for a document, but it can have unexpected effects, so I don't recommend it.

The second idea you mention, using Tools > Templates and Add-ins is better. You can add a template to your work environment using this tool, and the macros will become available while using Word. After adding in a template in this manner, it will appear in this list the next time you start Word, but it will not be automatically active. You have to execute the command, and check the box next to the template's name.

If you want the template to load automatically when starting Word, you can add a shortcut to the template in the Word Start Up directory. You can determine where this is through the Tools > Options > File Locations tab. Each time you start Word, the template will be loaded.

We have done this successfully here in my office, and have also stored a menu item in the template. When the user starts Word, an item appears in the menu bar called "SMMA Spec Tools." Under this list are the most commonly used macros that I've written for specifying. You could also create a separate tool bar for your macros and store it with the template.

Hope this is helpful.
Christopher E. Grimm, CSI, CCS, LEEDŽ-AP, MAI, RLA
Senior Member
Username: tsugaguy

Post Number: 128
Registered: 06-2005
Posted on Monday, March 17, 2008 - 09:29 pm:   Edit PostDelete PostPrint Post

The Word startup folder method worked perfectly for what I needed, and one of our IT guys and I found we could easily push the file out from a central location using a login script. Actually too easily. Seeing an unfamiliar toolbar caused a bit of concern for one user. Even though I had given demos a couple of times at department meetings, turns out we didn't have the full buy-in I had hoped for - i.e. be careful if you decide to try this that all users are for sure ok with it and prepared. So we changed the deployment method by writing a batch file to add/update the macros to the user's Word startup folder at the user's discretion. We also wrote a batch file that removes the toolbars and macros, in case anyone would rather let others test the waters with the new programs first. Thanks all for the tips.

I'll try to post a new macro here every now and then.
Philip R. Carpenter AIA
Junior Member
Username: philip_carpenter

Post Number: 2
Registered: 08-2008
Posted on Thursday, August 07, 2008 - 08:50 pm:   Edit PostDelete PostPrint Post

Try delving into the MS word discussion groups - you can quickly drown if you are not careful, but there is a tremendous amount of info there: http://www.microsoft.com/office/community/en-us/default.mspx?dg=microsoft.public.word.docmanagement&lang=en&cr=US

Add Your Message Here
Post:
Username: Posting Information:
This is a public posting area. Enter your username and password if you have an account. Otherwise, enter your full name as your username and leave the password blank. Your e-mail address is optional.
Password:
E-mail:
Options: Automatically activate URLs in message
Action:

Topics | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration