Results 1 to 4 of 4
  1. #1
    JustCallMeAl
    Guest

    Removing an Addin (Word97 SR2)

    I have a template that I addin, then via Application.Run, I run the procedure stored in that template.

    I need to remove the addin.

    So, I used:

    <pre> For Each adn In Application.AddIns
    If adn.Name = "EmailADocument.dot" Then
    adn.Delete
    Exit For
    End If
    Next
    </pre>


    Worked nicely. In fact, too nice. It deleted not only the addin matching the adn.name, but it also deleted the following addin: <pre>cmt-149 FaxEmailShipping.dot</pre>


    And that was disasterous.

    After much debugging--and it only broke when I did NOT have cmt-149 FaxEmailShipping.dot open in Word--I found out that it was at the For Each/Next loop that this was happening.

    So, I tried the backwards interation using Addins.Count Step -1....that one.

    Still happened.

    Any ideas?

  2. #2
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Removing an Addin (Word97 SR2)

    Hi Al,

    Can't replicate the problem in Word2000 ... but do you need the loop at all if you already know the AddIn is loaded, and you have it's name?
    You could try
    <pre>Application.AddIns("EmailADocument.dot").Dele te
    or
    Application.AddIns("EmailADocument.dot").Installed = False</pre>


    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Klaus

  3. #3
    JustCallMeAl
    Guest

    Re: Removing an Addin (Word97 SR2)

    Klaus, you're a genius!

    Thanks.

  4. #4
    JustCallMeAl
    Guest

    Re: Removing an Addin (Word97 SR2)

    ::smack::

    That sound you heard was the sound of my wooden mallot hitting the top of my head!

    Your solution, obviously, just slid right past me during development!

    I'll give that a try.

Posting Permissions

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