Order in which global addins are loaded

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15576
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Order in which global addins are loaded

Post by ChrisGreaves »

I would like to know the defined sequence in which addins are loaded.
My most immediate concern is my (Word 2000) Startup folder.
The folder currently holds 15 templates one of which has the ability to best-fit toolbars.
If I can make this template load last, I can then tell it to best-fit toolbars of all the loaded templates.
This is not a critical problem, but if anyone knows the answer off the top of their head I'd be most grateful.
There's nothing heavier than an empty water bottle

User avatar
HansV
Administrator
Posts: 78369
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Order in which global addins are loaded

Post by HansV »

Global templates (add-ins) are loaded in reverse alphabetic order, after Normal.dot.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15576
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Order in which global addins are loaded

Post by ChrisGreaves »

HansV wrote:Global templates (add-ins) are loaded in reverse alphabetic order, after Normal.dot.
Perfect! Thanks, Hans from Chris and the template formerly known as "Under"
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15576
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Order in which global addins are loaded

Post by ChrisGreaves »

HansV wrote:Global templates (add-ins) are loaded in reverse alphabetic order, after Normal.dot.
Since I did/could not rename Under.dot to be AAAUnder.dot without upsetting the apple-cart, I wrote a tiny AAA.dot and lodged it in my startup folder:

Code: Select all

Sub autoexec()
    Call Under.BestFitToolbarsByName
    ThisDocument.Close (wdDoNotSaveChanges)
End Sub
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15576
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Order in which global addins are loaded

Post by ChrisGreaves »

HansV wrote:Global templates (add-ins) are loaded in reverse alphabetic order, after Normal.dot.
This is the stuff of fantasy. :clapping: :fanfare:
It's been bugging me for about 8 years :hairout: , that I have to manually run the best-fit-toolbars macro after Word has loaded.
Now each time I load Word, it just wriggles itself into shape.
Perfect.
Makes me want to take the rest of the day off. (wanders off to the Cooking Forum ....)
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15576
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Order in which global addins are loaded

Post by ChrisGreaves »

HansV wrote:
22 Feb 2010, 14:15
Global templates (add-ins) are loaded in reverse alphabetic order, after Normal.dot.
As you might guess, my return to this thread heralds an anomaly of some sort. In particular I suspect that I am confusing two different sorts of automatically-loaded templates:-
(1) DOT files in the MSWord Startup folder
(2) DOT files in other folders that have been loaded into the Tools, Addins table manually or programmatically (which is my current project).

For now let's stick to DOT templates in the Startup folder, so as not to confuse me too much.

First:
If Normal.dot is loaded first, any “autoexec” within Normal.dot will execute to completion before any global templates are loaded.
Right?

In theory, an “autoexec” macro within Normal.dot might find global templates listed within the Addins collection, but those templates ought not be fully loaded yet, just labels, on pigeon-holes waiting to be filled.

Second:
To execute a macro after everything is loaded and before control is handed to the user, I would need a global addin template named "AAAAA" or similar with a Document_Open macro (that wrapped up tasks of Normal.dot).

Does my logic make sense to you (all; anyone who is listening)?

Thanks
Chris
There's nothing heavier than an empty water bottle

User avatar
HansV
Administrator
Posts: 78369
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Order in which global addins are loaded

Post by HansV »

As far as I know, yes to both questions.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15576
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Order in which global addins are loaded

Post by ChrisGreaves »

HansV wrote:
06 Dec 2021, 10:11
As far as I know, yes to both questions.
Thanks Hans. I spent part of today trying to fathom sequences. The attached ZIP file at the foot under the heading "Trial" has details.
I made six templates, loaded A, H and P into the startup folder, E, M and T into general folders and added those last three with Tools, Addins.
(1) I see the Normal.dot Autoexec macro execute, and then the "A" Autoexec macro, but not the H or P.
(2) If I disable A, I see only Normal; still no sign of H or P.
(3) The general templates E,M,T do not execute and they are not enabled in the Tools, Addins panel.
(4) For my immediate purposes I am thinking of reverting to a standalone application called "Addin" and executing that from a command-line switch, so that regardless of Normal.dot, I can manage Addins for the user as soon as Word2003 is loaded and before the user obtains control.
My goal is to do away with using Word's Startup folder.
Cheers
Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15576
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Order in which global addins are loaded

Post by ChrisGreaves »

ChrisGreaves wrote:
06 Dec 2021, 21:41
... My goal is to do away with using Word's Startup folder.
http://www.chrisgreaves.com/Downloads/20211208_1333.zip
This >255KB document has at its end a section "Wednesday, December 08, 2021", in which I puzzle over what appear to be Global Addins when I don't have any global addins!
The culprit seems to be the hypothetical Normal.dot developer, who I have named "'Charles Kenyon" to distinguish him from me, the humble user "Chris Greaves".

My conclusion: If a Normal.dot developer makes use of a template (VBE Tools, References), then that template will be visible and available to the end-user - unless the developer does some very clever stuff in VBA, which stuff I have not yet worked out.

Cheers
Chris Greaves
There's nothing heavier than an empty water bottle

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15576
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: Order in which global addins are loaded

Post by ChrisGreaves »

ChrisGreaves wrote:
22 Feb 2010, 13:56
I would like to know the defined sequence in which addins are loaded.
I discovered this (to me) oddity today. I can't recall having seen it before. It may be local to the Addins Collection, or it may be local to any Collection that can be interrogated by the end-user.
Word2003 still:
Untitled.png
I am single-stepping through a loop.
At the first breakpoint in VBE, as the developer I inspect the variables, including "AddinItem.Installed". All is OK.
At the second breakpoint I Alt-Tab into Word2003 and as the user inspect Tools, Addins. I see what I expect to see.
I Alt-Tab back into VBE and resume single-stepping at that second breakpoint, which brings me the Run-time error '5825'

I figure that my user-action of inspecting what as a developer I know to be the Addins Collection resets the value of the Addins Collection.

Of course, there are not two individuals using this keyboard; just little old befuddled me.
Still, I didn't expect that looking at the collection would reset it.
I can see why Word might assume that a user loading Tools, Addins is a good time to refresh/reset the collection, regardless of whether a user made changes to it.
Cheers
Chris
You do not have the required permissions to view the files attached to this post.
There's nothing heavier than an empty water bottle