Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Mar 2002
    Location
    Tampa, Florida, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word 2000 Obj. Heirarchy

    I have a question about the Word 2000 Object heirarchy.... I think.

    I developed a series of macros, including a form, on one PC. They work fine. However, when I install normal.dot on another PC running Word 2000, I get an error when I run a macro: "could not open macro storage." Inside the VBA editor, he calls it a 5981 error. I could find no reference to this in the VBA help file.

    When I open the VBA project editor on my development PC, it shows 2 projects: Normal and Document 1. Under the heading Normal, it shows 3
    entries:
    ThisDocument;
    myform1, my form; and
    NewMactros, my macros project.

    However, when I open the VBA project editor on my production PC, it shows just a single entry: Normal. Underneath that there are 3 items:
    Microsoft Word Obejct;
    Forms; and
    Modules.

    Underneath Microsoft Word Obejct is ThisDocument; underneath Forms is myform1; and underneath Modules is NewMacros.

    In other words, the structure is different. I suspect that is why I am getting the error message.

    In my form I a trying to establish values for objects on the form in the initialize sub. It works fine on my development PC, but blows up on my production PC; the error message is that the object cannot be found.
    Again, I suspect this has to do with the structure of the modules and forms, but I do not know how to correct it.

    I noticed the problem only when I added the form to the project, but I suspect the structure was the way it is from the beginning.

    When I start Word on my production PC with an empty normal.dot, I cannot duplicate the structure that I find on my development PC. I suspect this is because of a setting in the registry, but I have no idea how to find
    it. Both PC's are running the same version of Word, both under Windows 98.

    Does anybody have any experience with this and a way to correct it? And, more importantly perhaps, is this stuff documented anywhere, and if so, where? This is killing me!

    Thanks.

    hmc

    hchicowitz@aol.com

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word 2000 Obj. Heirarchy

    You have entered the classic no-man's (or woman's) land of Normal.dot anomalies. If I were you, I'd quickly adopt the stand that you will not program any Normal.dot but your own. Normal.dot is better named My.dot. Learn to use global add-ins (templates you create and name -- .dots) that are activated for use on user PCs either through the Startup Folder on a network folder or the Word Command line. Search the VBA forum for "normal.dot" to start your education.

    Sounds like you're just getting started with VBA in Word, so now's the time learn how to set up your development and deployment environment correctly.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  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: Word 2000 Obj. Heirarchy

    This is unhappy news, if true:

    <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/q247/0/28.asp>INFO: Corrupt Normal.dot Causes Errors When Automating Word</A>

  4. #4
    Lounger
    Join Date
    Mar 2002
    Location
    Tampa, Florida, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word 2000 Obj. Heirarchy

    Thanks.

    I was reading about managing VBA projects in Woody's Office book (pg. 1346) when I received your reply. Indeed, moving the macros and form to a separate DOT file appears to work. Though I was going a different direction because I was convinced that this was a configuration problem that a setting in the registry could fix.

    So, part of the answer to my question is that there should be no "Microsoft Word Object" entry. But that is just a symptom. The more direct answer is that this condition is a bug in Word; the way to get around it is as Kevin indicated.

    The knowledge base article that jscher200 pointed to merely confirms the existence of the bug, though they do not call it that. They call it a corrupt normal.dot file. Yeah, it is unhappy news, and it is true. I donno.... there was no corruption apparent on my development PC. (And just how did normal.dot come to be corrupt? Hmmmmmm.)

    Anyway, the better thing to do is to put the forms and macros in a separate dot file. That apparently gets around the shortcomings in this aspect of Word.

    Two things that I have learned (that I have yet to find in Woody's book or the Microsoft VBA help file): 1. When you place the other dot file in the startup directory, Word loads it automatically when Word starts; and 2. You must have this DOT file open in order to edit the macros in it.

    It's always something......!


    I am indeed new to VBA, though I wrote a few macros for Word 6 (I think) 7 years ago, and my programming experience goes back to Fortran more years ago than I wish to admit. One advantage to Fortran was that you find an explanation and workaround to error messages and bugs fairly easily. That was back in the days when they believed in documenting the language. Pardon me for waxing nostagically....

    This forum is a big help. Thanks.

Posting Permissions

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