#1   Report Post  
Posted to microsoft.public.word.docmanagement
kill_beast[_2_] kill_beast[_2_] is offline
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Jollans Tony Jollans is offline
external usenet poster
 
Posts: 1,308
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
kill_beast[_2_] kill_beast[_2_] is offline
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman Jay Freedman is offline
external usenet poster
 
Posts: 9,854
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Macros? Rosiewednesday Microsoft Word Help 2 June 24th 08 06:14 AM
macros starrdustn Microsoft Word Help 1 March 28th 08 06:38 AM
How do I build a modular database? CWG48 Microsoft Word Help 1 August 21st 07 05:19 PM
Macros dblafrase Microsoft Word Help 1 January 18th 06 12:09 AM
With macros enabled I still receive "macros disabled" warning. Blakthorne Microsoft Word Help 6 November 1st 05 07:20 PM


All times are GMT +1. The time now is 01:58 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"