Inter-Template communication

E

edamron

Currently my Department uses Office 2003 but we are soon moving to
Office 2007. We have over one hundred complex macros in various Word
2003 templates that interface to a database and pulls in information
to assist our users. All of these macros will need to be converted to
Word 2007.

In the current system there are a lot of common routines that are
duplicated in most of the templates containing these macros. Although
when I originally coded these macros I considered consolidating all of
this code in one place but decided against it because using the
"Application.Run" method to call hundreds of different subs and
functions from a common template seemed too clumsy and I felt that the
code would quickly become unmanageable.

The issue has once again raised its ugly head and I'm pretty much
being told that this is how it's going to be.

I would like to ask the community a few questions:

1. How unmanageable is the code going to be?
2. Has calling code between templates been improved in Office 2007?
3. If not am I overlooking some other way to do this. (My supervisor
is leaning against VSTO so that is apparently not an option either.)
4. Any helpful suggestions?

Thank you
 
D

Doug Robbins - Word MVP on news.microsoft.com

You probably do not need to do anything. Your Word 2003 templates should
run in Word 2007 without any changes being required.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 
M

Manfred F

Hi,

edamron said:
... Although
when I originally coded these macros I considered consolidating all of
this code in one place but decided against it because using the
"Application.Run" method to call hundreds of different subs and
functions from a common template seemed too clumsy and I felt that the
code would quickly become unmanageable.

Using "Application.Run" is not the preferable way to consolidation. Instead,
put your global functions template into the startup folder, and define a
reference to it from the calling template.
"Application.Run" can be used exceptionally, but it has limitations: it
won't transfer error events (can be cured via extra-parameters), and it
messes up the event handling sometimes (windowSelectionChange event).

Regards,
Manfred
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top