Results 1 to 12 of 12
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word VBA: Failure to delete a toolbar (Word VBA)

    A bit over 3 years ago, I posted a problem that I, and several others, have reported in these newsgroups.
    See http://www.standards.com/OhMyWord/VBABugsF...l#DeleteToolbar.

    I first noticed the problem in Word 2000, then Word 2002. Today, I confirmed that the problem also exists in Word 2003.

    When such a problem persists for so many Word versions, it means that MSFT is really screwing up by not fixing the problem, or there was a fundamental (mis)design error in Word 2000 and beyond.

    I do not recall whether the problem exists in Word 97, nor do I really care.

    Anybody know of a work around?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word VBA: Failure to delete a toolbar (Word VBA)

    This might be a more useful thread if you explained what the bug is, Howard. Not everyone will be willing to follow a link and download a file without knowing just exactly what problem they're chasing. If you'll forgive my saying so, "delete toolbar" is not very definitive and the subject doesn't explain whether you are unable to delete a toolbar when you try it in code, from the customize dialog, or where. Or does it mean that you delete it but it comes back. If you really want to start a dialog here, you need to explain the problem here, no matter what you have posted on your web site.
    Charlotte

  3. #3
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word VBA: Failure to delete a toolbar (Word VBA)

    The subject is "Failure to delete a toolbar", not "delete toolbar".

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Word VBA: Failure to delete a toolbar (Word VBA)

    The subject is ambiguous, regardless of what is included, Howard. You still need to explain what it means in your post. And your link does use "deletetoolbar".
    Charlotte

  5. #5
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Quakertown, PA, Pennsylvania, USA
    Posts
    517
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word VBA: Failure to delete a toolbar (Word VBA)

    Hi, Howard.

    At the risk of looking like a complete numbskull, I did look at your template file and saw all kinds of code to delete the toolbar. Now, I'm no coder, but I've used this code in many templates, without problems:

    Private Sub Document_Close()

    'This closes the Templates toolbar when the document is closed. It also keeps the user from
    'changing the template. This is what we call an *on-event* procedure (macro) because it is
    'run when the document is closed.

    On Error Resume Next
    CommandBars("Menu Bar").Controls("Te&mplates").Delete
    ActiveDocument.AttachedTemplate.Saved = True

    End Sub

  6. #6
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Quakertown, PA, Pennsylvania, USA
    Posts
    517
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word VBA: Failure to delete a toolbar (Word VBA)

    Running Word 2000 SR-1.
    I run your code, and the Strings toolbar is NOT deleted.
    I open the doc and it is NOT recreated.
    Am I doing something wrong?
    I have 97, 2K, XP, and 03 here. I will test till the day is long, if you just tell me what you need me to test.
    And then I'll have some coders take a good look as soon as I figure out what's wrong.

    [img]/forums/images/smilies/smile.gif[/img]

  7. #7
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Quakertown, PA, Pennsylvania, USA
    Posts
    517
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word VBA: Failure to delete a toolbar (Word VBA)

    Haha.
    Okay, so I'm running around the internet and see some Word Q somewhere...open Word. Voila! TWO toolbars. Hm!! I'm posting your link on our forum as a challenge, Howard.

  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word VBA: Failure to delete a toolbar (Word VBA)

    Don't spend too much time on this.
    It's been a known problem that others have also seen.
    MSFT just screwed something up in whatever release I first saw the problem, and despite several reports in MSFT newsgroups, and likely other forums, MSFT has not fixed the problem.

  9. #9
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word VBA: Failure to delete a toolbar (Word VBA)

    What forum is that?

  10. #10
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Quakertown, PA, Pennsylvania, USA
    Posts
    517
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word VBA: Failure to delete a toolbar (Word VBA)

    Here's the Q, Howard:
    http://www.vbaexpress.com/forum/showthread.php?t=1026

    Interesting input, too.

  11. #11
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word VBA: Failure to delete a toolbar (Word VBA)

    Yes, interesting input, alas, all been tried before.

    Changing the timing, by splitting the code, does not always work.
    Tried that many times, not always successful.

    In the real applications in which I have encountered the problem, the code is not always so close together, so there's no simple timing solution.
    I constructed the example to exacerbate the timing aspect.

  12. #12
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word VBA: Failure to delete a toolbar (Word VBA)

    Here's a simpler URL (requires Javascript be enabled).

    http://www.standards.com/links.html?...oDeleteToolbar

Posting Permissions

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