Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Apr 2005
    Location
    Houston, Texas, USA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Project Names and Custom Menus (Word VBA 2002)

    I inadvertently named my Project Normal(AllMacros). (I had to regenerate my Normal--so I saved my old Normal under the name "AllMacros." ) I still have a regular Normal Project. I had thought the only way to put my macros in another project was to make another template (called something other than Normal). I don't understand what this means--although it did solve a problem I had been having. (So maybe I should just shutup and be happy, but I would like to know why.)
    The problem it solved was this. I could never get my other templates to load my custom menus when I used Tools/Add-in to add them when I was in a Normal doc. This new project Normal(AllMacros) gives me my custom menu when I add it with Tools/Add-in. I never wanted to save all my macros in Normal, but that had been the only way I could easily access them. So can someone tell me what I have done and how I can seemingly have 2 Normal templates. Thanks.

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

    Re: Project Names and Custom Menus (Word VBA 2002)

    When you rename your Normal.dot, Word won't use it as default template any more. It will still list a "Normal" in the Visual Basic Editor. This is a "virtual" template contianing the factory settings until you customize it, then Word will (try to) save a new Normal.dot.
    It is perfectly possible to load several files named Normal.dot, however, only the one in your templates folder will be used as default template.
    I don't know why the old one didn't show custom toolbars - perhaps it had become corrupt.

  3. #3
    New Lounger
    Join Date
    Apr 2005
    Location
    Houston, Texas, USA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Project Names and Custom Menus (Word VBA 2002)

    I didn't quite say it right when I made my first post. I don't have 2 "Normal.dots." I have a new template called "AllMacros.dot." When I look at AllMacros.dot in the VBA editor, the Project is called "Normal(AllMacros)." Whenever I have created new templates before, the project was called "Template Project(MyNewTemplate)." I had never seen the project name get called "Normal" before. Perhaps my questions should better be "Is this ok? Will this mess with my default Normal?" And also, I guess I am wondering about what the naming of projects means? That is, what does "Project Template" represent in the name (i.e., is this the name of the project?) And what does the part in parentheses represent? (i.e., I thought THIS was the name of the project?).

    These are probably VBA 101 questions, but I can't find any explanation in my books.

    As far as the custom menus goes, I had tried to figure out what the problem was with that and couldn't. I figured my workaround was better than delving too deeply in the registry (which is what one Poster on Woody's suggested).

    Thanks for your first reply.

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

    Re: Project Names and Custom Menus (Word VBA 2002)

    A Word document or template has two names: the file name as displayed in Windows Explorer, and an internal VBA project name that is displayed in the Visual Basic Editor. You can set this VBA name by clicking on the file/template in the Project Explorer (the explorer-like pane on the left hand side) and changing the Name property, or by selecting Tools | <Project> Properties... where <Project> is the current VBA name.
    (Note: if you want to change the VBA name of a global template/add-in, you must open it as a document in Word. If it's only loaded as a global template/add-in, you can't change it, nor view/edit the code)

    The indication "Normal (AllMacros)" in the Project Explorer means that the VBA name is Normal, and the file name is AllMacros (.dot). The VBA name Normal dates from the time that the file functioned as your default template. Changing the file name from Normal.dot to AllMacros.dot hasn't changed the VBA project name, so that is still Normal. This won't hurt, except in rather special circumstances: if you want to call a function or procedure from a specific project. In that case, duplicate project names can cause problems. Otherwise, no reason to worry.

  5. #5
    New Lounger
    Join Date
    Apr 2005
    Location
    Houston, Texas, USA
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Project Names and Custom Menus (Word VBA 2002)

    Thanks Hans. That explanation was very helpful. I suppose that means that most of my other templates are then all called by the same VBA name "Project Template." I always thought the words "Project" and "Project Template" were sort of category designations, not names that could be changed. I don't usually refer to procedures in other projects, so guess I won't bother renaming my projects. With trying to name my procedures, modules, forms, and files, I have enough naming to do.
    Thanks again for taking the time to explain things.

Posting Permissions

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