Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    custom menu remains on all open docs (Word 2000/sr1)

    We have a COM addin that creates an addition menu and the sub menu items may be different based on the template that the document was derived from. The problem we are seeing is that the last document's menu is the one that appear on any of the previous opened documents. Using the same code in Excel does not produce this problem and since Word makes use of referencing the template where Excel doesn't we are thinking the methods uses with Excel do not apply.

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: custom menu remains on all open docs (Word 2000/sr1)

    If you want to create different toolbars or menus for each open document then you need to create a routine that sets the appropriate toolbars and call it from the DocumentChange event in a class module.

    StuartR

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: custom menu remains on all open docs (Word 2000/sr1)

    Word has a CustomizationContext setting that is supposed to control the container to which CommandBars.Add and similar commands are applied. It works mostly, sort of. You can read more in Help and experiment with various formulations to find one that works for you. I think by default, CustomizationContext = NormalTemplate.

  4. #4
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: custom menu remains on all open docs (Word 2000/sr1)

    Thanks jscher2000. The CustomizationContext not only solved our problem with documents retaining their own menus but CustomizationContext also solved another problem we were looking at. The problem was when we closed a document we were always getting prompt if we want to save normal.dot and prompt to save the template the document was referenced to. Since using CustomizationContext those prompts have not returned.

Posting Permissions

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