WD: Level Argument Does Not Correspond to Heading Level

Last reviewed: February 5, 1998
Article ID: Q140180
The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for the Macintosh, versions 6.0, 6.0.1
  • Microsoft Word for Windows NT, version 6.0
  • Microsoft Word for Windows 95, versions 7.0, 7.0a
  • Microsoft Word 98 Macintosh Edition
  • Microsoft Word 97 for Windows

SYMPTOMS

When you create a macro to apply page numbers that include chapter numbering, the Level argument does not pick up the correct heading level. For example, the following macro applies page numbers that incorrectly include Heading 2 numbering, not Heading 1 numbering:

   Sub Main
      FormatPageNumber .ChapterNumber="1", .Level="1"
   End Sub

When you record the macro, Word specifies the Level consistent with the documentation, for example:

   Sub Main
      FormatPageNumber .ChapterNumber="1", .Level="0"
   End Sub

WORKAROUND

Modify the Level argument so it is equal to the heading level minus 1. For example, to specify a Heading 1 level, the argument is:

   .Level = 0

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

The "Microsoft Word Developer's Kit," page 477, the "Microsoft Word Developer's Kit, Second Edition," page 507, and online Help for the products listed above, correctly state:

   A number corresponding to the heading level applied to the first
   paragraph in each chapter (for including the chapter number with the
   page number).

Word 97 for Windows or Word 98 Macintosh Edition

This feature works as documented in Word 97 for Windows and Word 98 Macintosh Edition as follows:

   HeadingLevelForChapter Property

   Returns or sets the heading level style that's applied to the chapter
   titles in the document. Can be a number from 0 (zero) through 8,
   corresponding to heading levels 1 through 9.

REFERENCES

"Microsoft Word Developer's Kit," version 6.0, page 477 "Microsoft Word Developer's Kit," Second Edition, pages 507-508


Additional query words: formatpagenumber format page number
Keywords : macword ntword winword word6 word7 word8 word95 word97 wordnt macword98 kbcode kbmacro kbprg
Version : WINDOWS:6.0,6.0a,6.0c,7.0,7.0a,97; MACINTOSH:6.0,6.0.1,6.0.1a,98
Platform : MACINTOSH WINDOWS
Issue type : kbbug
Solution Type : kbworkaround


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 5, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.