Results 1 to 5 of 5
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    References (Word 2002 XP SR3)

    We have a global template that contains all the library code lets call this template "Library.dot"

    All the local templates have references to the Library.dot template.
    ie in VBA goto menu Tools, References...browse and select the global template

    As the library.dot template stores all the library code, this template is getting quite big and also is a bottleneck in terms of holding up projects, when multiple developers work on different projects and need to modify library code.
    I want to move one of the main modules in library.dot and create a new global template to store the main module.

    However I have a feeling for all the local templates Im going to have to add this new template reference, which will be a big job.
    Can I piggy back or link somehow off the library.dot template?

    Is there anyway around this?

    mmm...

    diana

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,853
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: References (Word 2002 XP SR3)

    Have you explored the possibility of adding an AutoOpen macro to the Library addin which checks the attachedtemplate has a reference set to the new addin and sets it if necessary.

    Another possibility is that you keep the original macro names in the Library (which just point out to the new addin) but move the bulk of the code to the new addin and so the Library itself needs the reference to the new addin but the attached template would not.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: References (Word 2002 XP SR3)

    I've only done a quick test, so it might not be conclusive, but I get the impression that references don't work in a chain of templates.

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: References (Word 2002 XP SR3)

    >Is there anyway around this?

    Yes.
    I do it frequently.
    I am running an application called Converter.dot.
    It has a reference to a library of code called FileR.dot.
    FileR.dot has a reference to a library of code called UW.dot.

    I am running an application called Precis.dot.
    It has a reference to a library of code called Indexer.dot.
    Indexer.dot has a reference to a library of code called UW.dot.

    In your case you might store all your common generic VB code (string manipulation, file business, array handling etc) like me in a library called UW.dot. Utility code in UW.dot is generically suitable for use by Word, Excel, PPT, Outlook, Project etc etc (But would have to be transferred module by module to an appropriate UX.XLA and so on).

    The remaining code could be stored in a separate module called MyApplicationLibrary.dot or whatever.


    >I want to move one of the main modules in library.dot and create a new global template to store the main module.
    Extract the main module from library.dot and store it in, say, MyCommon.dot.
    make a reference from Library.dot to MyCommon.dot, and you should be alright.

    Unless I've misunderstood you.

  5. #5
    Silver Lounger
    Join Date
    Jul 2001
    Location
    Ottawa, Ontario, Canada
    Posts
    1,609
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: References (Word 2002 XP SR3)

    Hi Diana
    I have a similar situation with Word and approach it as follows.
    <UL><LI>The master library sits on the server in a folder which protects its files against everything but copying
    <LI>Within this protective folder are the add-ins which contain: (1) the library of macros; and (2) the management add-in. These files are named such that on launching Word, the management add-in is opened before the library.
    <LI>An Install file sits outside this protective folder. The Install file copies both files from the protective folder to the user's add-in folder
    <LI>On opening, the management add-in compares the time-date stamp of the library add-in on the server with that on the user's machine, and if there is a discrepancy replaces the user's copy of the library add-in;
    <LI>On closing, the library add-in compares the time-date stamp of the management add-in on the server with that on the user's machine, and if there is a discrepancy replaces the user's copy of the management add-in;
    [/list]
    Regards
    Don

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •