Results 1 to 1 of 1
2003-12-11, 19:59 #1
- Join Date
- Feb 2001
- Yilgarn region of Toronto, Ontario
- Thanked 0 Times in 0 Posts
Unhooking NORMAL.DOT via VBA (Word97)
The following procedure (with its embedded TEST procedure) attempts to de-activate templates in the Add-In list, so that I can rename or move some of the templates.
Even though it happily executes Ad.installed=false, some templates are still un-moveable because they are attached to some other template that is not un-installed.
I have a particular case where my NORMAL.DOT has a reference to my UTILS.DOT.
I want to move in a new version of UTILS.DOT, but although I have set .Installed to FALSE for the Utils.dot (no errors), it remains very much alive, and when I try to rename the Utils.DOT (e.g. to Utils.DOT.001), my try fails, because Utils.DOT is still very much alive and kicking, because Normal.dot references it.
I can't load Word WITHOUT Normal.DOT, because the user is running this template, perhaps by dragging the template to an icon of Word, so by the time I am active, it is too late for run-time switches.
This is a more general case of ANY template referencing another template; e.g. my NEIGH.DOT references UTILS.DOT. I want to change utils.dot, but have no concerns with NEIGH.DOT. I'd generally leave NEIGH.DOT installed, but I can see that I may well have to de-install ALL AddIns, do my work, then re-install all AddIns.
<pre>Public Function AddInDEActivate(strAddIns() As String)
' Deactivate each add in in the list
Dim lngAdd As Long
For lngAdd = 0 To UBound(strAddIns)
Dim AdWork As AddIn
Dim ad As AddIn
For Each ad In AddIns
If blnGenericMatch(ad.Name, strAddIns(lngAdd)) Then
ad.Installed = False
' Dim strAddIns() As String
' Dim lngCountAddIns As Long
' lngCountAddIns = lngAddinsCount(strAddIns)
' If lngCountAddIns > 0 Then
' Call AddInDEActivate(strAddIns)
' Call AddInREActivate(strAddIns)
' End If