Results 1 to 3 of 3
  1. #1

    When is an AddIn Loaded in Memory?

    Word97 SR2

    Clearly, if it is not listed in Tools, Templates and AddIns, it is probably not in memory.

    However, is the AddIn loaded in memory when it is in the Templates and AddIns list but not checked (not installed)?

    Or, is it when they are installed (checked)?

    Now, how about when you reference a template. Document A references template X. Is template X only loaded into memory when you open Document A? Then it is removed from memory when you close Document A? (Most of the time, I seem to recall seeing template X listed in the Templates and Addins list when Document A is open.)

    The problem I am coming to is how to deal with memory management issues so we don't have to keep installing more and more memory to allow us to use our system. In other words, our current global addin, beyond the user's own, is nearly 1.6 MB. Much of the code is "launching" type code. IOW, when a document is being created, much of the document creation code resides outside the global addin.

    However, some of the code, and some that I am current developing, could be accessed via a reference. Load the reference, use the code, unload the reference.

    Well, enough for rambling. As we discuss, I'm sure my thoughts will congeal more.


  2. #2
    Super Moderator
    Join Date
    Dec 2000
    New York, NY
    Thanked 29 Times in 27 Posts

    Re: When is an AddIn Loaded in Memory?

    Hi Lawrence,

    Templates that are members of the AddIns collection will be listed in Tools>Templates and AddIns list, but they're not loaded into memory unless they are checked (or to quote the label in the dialog "Checked items are currently loaded"<g>).

    As far as loading when a template is referenced, a referenced template can be either the attached template, or another global template.

    In terms of a simple attached template, the attached template will always be loaded into memory when a document based on it is open. But even if you open 100 documents based on this template, only one 'copy' of the attached template will be loaded - at least that's my interpretation of what you see in the Project Explorer window.

    It's probably a safe bet that referenced global templates behave the same way - I've never seen multiple instances of a global template showing in the Project Explorer - just one. So while the 1.6MB global template might present a slight lag when launching Word, it shouldn't cause memory issues.

    Loading and unloading the reference as needed surely sounds like an interesting approach, but it might not really be necessary as compared with keeping the global template in Startup and having it loaded all the time.

    Just my take anyway...


  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Yilgarn region of Toronto, Ontario
    Thanked 0 Times in 0 Posts

    Re: When is an AddIn Loaded in Memory?

    What was that crazy test I ran a couple of months ago when i dragegd every template on my system (256? 600?) into a startup folder and fired up Word. remember? I met GeoffW in Sydney for takeawy Chinese while it was loading? (g!)

    I think that there is a difference between (1) Word opening the file that is an Addin/Global and (2) compiling ("tokenising") the macros within.

    Having 100 templates available takes little time. The FIRST time a macro is run, there's a flurry of disk activty, along the lines of "Oh. You want to RUN one of these? Hang on ....".

Posting Permissions

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