Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Custom Toolbar in Protected Document (Word 2003)

    Hi All!

    I'm having a heck of a time with a custom toolbar. If I open the template itself, it shows up just fine. But if I open the template as a document, my toolbar is nowhere to be found.

    I actually have two of these documents; the one that has no protection, which I created a while ago, works just fine. It's the one with protection, which I just made, that loses its toolbar. I believe (although have no certain way of knowing) that I used the same approach for making both.

    Additional information: in the unprotected document, my "Update" toolbar is visible in both the template and the document in organizer view. In the protected document, the "Update" toolbar is available in the template, but it is not available in the document, in organizer view.

    How do I get the toolbar to be available to a specific template but also available when opened as a document?

    Any ideas?

    Thanks!

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    Open the template as a document and activate the Visual Basic Editor (Alt+F11).
    Check the ThisDocument module to see if there is a Document_New and/or Document_Open event procedure.
    Also check if there are modules under the Modules section, and if so, see if there is one containing an AutoNew or AutoOpen macro.
    There might be code that creates a toolbar on the fly - look for CommandBars.Add.
    Let us know what you find.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    Could you do the following:
    - Remove all text from the problem template.
    - Save it under another name (still as a template)
    - Zip the new template.
    - Attach the zip file to a reply.

    Added - oops, you already did that <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    LOL my psychic ability...

    I didn't remove the text from the document, but I can do that if you'd like?

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    > I didn't remove the text from the document, but I can do that if you'd like?

    No, that was just in case it contained sensitive info.

  6. #6
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    BRILLIANT.

    That's what happens when we let the guys upstairs create our templates and then force us to use them. I did have a sneaking suspicion at one point about that but then forgot about it, 'cause the guy who did the template is a bigwig IT guy in that department.

    The lesson: NEVER trust other people's templates.

    Please forgive me for deleting the attached file, but I think the description of what is wrong with it is enough for anyone to follow what happened.

    Would you mind deleting yours, too, Hans?

    Thanks!!!!

    <img src=/S/trophy.gif border=0 alt=trophy width=15 height=15>

  7. #7
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    And I was so tempted to just address this post to Dear Hans! <img src=/S/angel.gif border=0 alt=angel width=15 height=21>

    ThisDocument doesn't contain anything. There are no Document_New or Document_Open event procedures.

    There is one module called basMain and it has one function called showMyForm and all it does is show the form in question.

    There isn't any Commandbars_Add or anything of the sort.

    Putting the toolbar into the Normal.dot doesn't help either, then I'm just always stuck with the toolbar, which I want only available when my template opens (and hopefully opens as a doc, not a template).

    Just for kicks, here's a copy. The functionality of the form won't work, but maybe you can see my toolbar problem?

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    The problem is that this "template" is actually a document whose extension has been changed from .doc to .dot. This means that the template "framework" is missing. If you save the file from within Word as a template, that framework is added, and the toolbar will work as intended.

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    OK, done.

  10. #10
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    I am still amazed and awed how I can agonize over something for more than a day, but for you it is a 5-minute fix. Or perhaps less.

    <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15>

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    I noticed that the Tools | Templates and Add-Ins... dialog showed the name of another template in the Document Template box near the top. For real templates, this box is empty and disabled.

  12. #12
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    Hey, Hans...If you happen to have a spare moment....another question, same form, probably similar problem....

    So I had two of these forms that pretty much do the same thing. One of them works perfectly fine. The other one, if I open it as a document and then save it and close it...then go back to open it again, it gives me the message "are you sure you want to open your WordTemplate.dot" and on closing, "do you want to save changes to your WordTemplate.dot" instead of wanting to save to the document.

    Is there possibly something else that is a bit bonkers in the form? What should I look for?
    Attached Files Attached Files

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    Let's get the terminology straight.

    If you open a template, you'll see the name of the template (AnnualAudit.dot) in the title bar. If you edit it then close it, you'll be prompted to save changes to the template.

    If you create a new document from the template, you'll see something like Document3 in the title bar, and if you edit then close it, you'll be prompted to save changes in the document.

    If your macro security is set to Medium, you'll be prompted to enable the macros in the template when you open the template or create a new document based on it, or open an existing document based on it, unless you have stored the template in your default templates folder and ticked the check box "Trust installed templates and add-ins" in the Trusted Sources tab of Tools | Macro | Security.

  14. #14
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    Do you use VBA code for "opening the template as a document from Access and saving it immediately"? If so, try using Documents.Add(templatename) instead of Documents.Open(templatename)

  15. #15
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    San Francisco, California, USA
    Posts
    358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Toolbar in Protected Document (Word 2003)

    Exactly. I've got the terminology straight.

    What's going on is I'm opening the template as a document from Access and saving it immediately in a predetermined folder with a predetermined name (made from Access data).

    The form that works properly, works properly, in that the predetermined name of the document shows up on the top of the document. When you close the form, if you've made no changes to the document, it closes with no fuss, and if you've made changes, it asks do you want to save the document.

    The form that works improperly (the attachment) DOES show the name of the document in the top, except during the Enable Macros portion, you are asked if you want to enable the macros from the .dot file. When you close the document, you are asked if you want to save changes to the .dot file.

    Does that make more sense?

    Edit: How do people attach screenshots to posts? I would post the screenshot if I could.

Page 1 of 2 12 LastLast

Posting Permissions

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