Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Mar 2003
    Location
    Elkins Park, Pennsylvania, USA
    Posts
    325
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Uber Template Disables Menus (Word XP)

    Good morning.
    I have a user who sent me a document whose template (apparently) has disabled or hijacked many of the standard commands. I have written code that strips macros from documents and detaches the document's template but it's not working in this case. In fact, when I select Tools: Templates and Add-ins... the Document Template option is blank and disabled. When I go to the VB editor, only the document is listed, not its template, so I can't even manually remove any code. This is an important in-house document (so there are no legal issues at stake), but at the moment, it's unusable.
    What's a geek to do?
    <font face="Comic Sans MS">That's what you do in a herd; you look out for each other!</font face=comic> - Mike

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

    Re: Uber Template Disables Menus (Word XP)

    Can you copy the contents of the document into a new document?

  3. #3
    3 Star Lounger
    Join Date
    Mar 2003
    Location
    Elkins Park, Pennsylvania, USA
    Posts
    325
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Uber Template Disables Menus (Word XP)

    Yes, the contents can be copied and pasted. My concern with this, though, is that the document into which it's pasted will have different styles and formatting assigned and applied. (I tried it, and although it looks very similar, there are differences with line spacing, etc.)
    I was able to "shake it off" by selecting Save As... from the Tools: Macros... menu and selecting RTF format. (Apparently, it didn't occur to the person that wrote the template to close this particular back door.) When I did that, I was warned that all macros associated with that file would be lost, which was fine with me. (I would have liked to see just what macros were in the document, but as I said, I didn't see anything in the VBA Editor.) The menus were still hacked... er, customized even after the save, but all was well once I closed and reopened the newly created RTF file.
    Still, I'd like to be able to create some tool to deal with that type of document, especially since there are many of them in that department that we will be inheriting; and my thinking is that writing code to save as RTF and then close and reopen the file might be less than elegant. Any ideas or insights that would allow me to create something slick that can deal with this sort of problem?
    <font face="Comic Sans MS">That's what you do in a herd; you look out for each other!</font face=comic> - Mike

  4. #4
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: Uber Template Disables Menus (Word XP)

    Mike, your description of the file makes it sound like it is actually a template and not a document - you can't attach a template to a template - which is probably why the attached template is disabled for you. Are you sure that this file is not a template that has been renamed as doc?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  5. #5
    3 Star Lounger
    Join Date
    Mar 2003
    Location
    Elkins Park, Pennsylvania, USA
    Posts
    325
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Uber Template Disables Menus (Word XP)

    Actually, I'm not at ALL sure of what I'm dealing with. This department used some jerry-rigged document management system (using Panagon) that housed files created using some bizarre, draconian templates. From that system, which is being retired, I've inherited documents ranging from fairly normal to documents that had code attached that I was able to easily strip, and now this kind of document, which both hobbles menus and which obviously has (or has had) code attached. What makes this last category hard to deal with is that I couldn't find any trace of code in the VBA editor, nor could I identify anything via my own utilities, which, among other things, looks for and disables modules attached to a file.

    Unfortunately, the system that was used has spawned legacy files that will have to be significantly cleaned in order to be incorporated in standardized and automated processes, and that task has been given to yours truly.

    To top it all off, our company last week upgraded all machines with, among other things, the latest SR of Word XP, which apparentlly consists of a new EXE which contains many under-the-hood changes to objects, collections, and properties, which we are slowly discovering as new error messages are popping up when running code that has been in use for several years (and which I cannot find clearly documented in the MSKB.)

    In the meantime, I caved in and just built a "tool" to do what I described before, which is to save it as RTF (to strip out code) and then back as a DOC file. It gets the job done, but if I can't understand what was going on, then I'm sure I'm going to keep being surprised!
    <font face="Comic Sans MS">That's what you do in a herd; you look out for each other!</font face=comic> - Mike

  6. #6
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New York
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Uber Template Disables Menus (Word XP)

    If these are older "documents," then I would guess the previous poster is correct in saying that they have the macros within, and that the document is actually a template.

    If theses are documents built by the management system since Word 2000, remember Documents can have macros stored within them now.

    The fact that the save to RTF strips out the code would suggest that the document management system was copying what it thought were necessary macros into each created document (what horrific programming practice that is...).

Posting Permissions

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