Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
modular macros
I tried creating a word document with macros, and reference it in other
documents so that all of my code is in one place. However, I can't get the other documents to save the reference. Is there a better way to do this? Create a library or something? Basically, I'm going to have 50+ Word documents, and I'd like the macro to be in one spot instead of saved seperately wtih each document. That way if I have to change the code, I won't have to update it everytime. Any ideas? |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
modular macros
On Mon, 15 Sep 2008 14:33:01 -0700, kill_beast
wrote: I tried creating a word document with macros, and reference it in other documents so that all of my code is in one place. However, I can't get the other documents to save the reference. Is there a better way to do this? Create a library or something? Basically, I'm going to have 50+ Word documents, and I'd like the macro to be in one spot instead of saved seperately wtih each document. That way if I have to change the code, I won't have to update it everytime. Any ideas? Macros should never (except in unusual circumstances) be stored in documents. They should be in templates. This has less to do with updating changed code, and more to do with the way Word handles macros and macro security. Essentially, macros stored in documents are always treated as potential viruses. Macros that are stored in a template (in the Templates folder) used to base new documents are available in all documents based on that document. Macros that are stored in a template located in Word's Startup folder are available in all documents. See http://www.word.mvps.org/FAQs/Macros...buteMacros.htm and http://www.word.mvps.org/FAQs/Custom...latesStore.htm for background. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
modular macros
I don't really know why but it doesn't seem sufficient just to add a
reference to another document (or template), you must make use of it for it to 'stick'. -- Enjoy, Tony www.WordArticles.com "kill_beast" wrote in message ... I tried creating a word document with macros, and reference it in other documents so that all of my code is in one place. However, I can't get the other documents to save the reference. Is there a better way to do this? Create a library or something? Basically, I'm going to have 50+ Word documents, and I'd like the macro to be in one spot instead of saved seperately wtih each document. That way if I have to change the code, I won't have to update it everytime. Any ideas? |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
modular macros
Well, the confusing thing is that the 50+ documents are all going to be
templates from which other documents will follow. I hoped that these documents (templates) could access their macro code from 1 location, since it's all going to be the same thing. Namely because I'm going to have to update this code at a later time int he future, and updating code for 50+ documents seems like a colossal waste of time if it's all the same. Any ideas? "Jay Freedman" wrote: On Mon, 15 Sep 2008 14:33:01 -0700, kill_beast wrote: I tried creating a word document with macros, and reference it in other documents so that all of my code is in one place. However, I can't get the other documents to save the reference. Is there a better way to do this? Create a library or something? Basically, I'm going to have 50+ Word documents, and I'd like the macro to be in one spot instead of saved seperately wtih each document. That way if I have to change the code, I won't have to update it everytime. Any ideas? Macros should never (except in unusual circumstances) be stored in documents. They should be in templates. This has less to do with updating changed code, and more to do with the way Word handles macros and macro security. Essentially, macros stored in documents are always treated as potential viruses. Macros that are stored in a template (in the Templates folder) used to base new documents are available in all documents based on that document. Macros that are stored in a template located in Word's Startup folder are available in all documents. See http://www.word.mvps.org/FAQs/Macros...buteMacros.htm and http://www.word.mvps.org/FAQs/Custom...latesStore.htm for background. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
modular macros
As I already said, "Macros that are stored in a template located in Word's
Startup folder are available in all documents." This is equivalent to the "macro library" you initially asked about. Put all your common macros into one template, and store that template in the Startup folder (which by default is the hidden folder %appdata%\Microsoft\Word\Startup). The other 50+ documents, if they really are documents (*.doc files), should not contain any macro code. If they are in fact templates (*.dot files) used to base new documents through the File New command or the VBA Documents.Add method, then some of them might be allowed to contain a few macros that are specifically required only by the documents based on them. I hope you did -- or will -- read and understand the articles I pointed to in my previous post. They explain the concepts that determine where you put macros. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. kill_beast wrote: Well, the confusing thing is that the 50+ documents are all going to be templates from which other documents will follow. I hoped that these documents (templates) could access their macro code from 1 location, since it's all going to be the same thing. Namely because I'm going to have to update this code at a later time int he future, and updating code for 50+ documents seems like a colossal waste of time if it's all the same. Any ideas? "Jay Freedman" wrote: On Mon, 15 Sep 2008 14:33:01 -0700, kill_beast wrote: I tried creating a word document with macros, and reference it in other documents so that all of my code is in one place. However, I can't get the other documents to save the reference. Is there a better way to do this? Create a library or something? Basically, I'm going to have 50+ Word documents, and I'd like the macro to be in one spot instead of saved seperately wtih each document. That way if I have to change the code, I won't have to update it everytime. Any ideas? Macros should never (except in unusual circumstances) be stored in documents. They should be in templates. This has less to do with updating changed code, and more to do with the way Word handles macros and macro security. Essentially, macros stored in documents are always treated as potential viruses. Macros that are stored in a template (in the Templates folder) used to base new documents are available in all documents based on that document. Macros that are stored in a template located in Word's Startup folder are available in all documents. See http://www.word.mvps.org/FAQs/Macros...buteMacros.htm and http://www.word.mvps.org/FAQs/Custom...latesStore.htm for background. -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macros? | Microsoft Word Help | |||
macros | Microsoft Word Help | |||
How do I build a modular database? | Microsoft Word Help | |||
Macros | Microsoft Word Help | |||
With macros enabled I still receive "macros disabled" warning. | Microsoft Word Help |