Re: Retrieving Previous Level Number from heading style

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Rusty (anonymous_at_discussions.microsoft.com)
Date: 02/23/04


Date: Mon, 23 Feb 2004 03:07:05 -0800

Many thanks Steve.

Cheers.

>-----Original Message-----
>G'day "Rusty" <anonymous@discussions.microsoft.com>,
>
>That ListLevel object has STACKS of properties and
methods that hold
>EVERYTHING about the list.
>
>Normallly I do this:
>
>Name all list templates in the doc.
>Find yer para of interest, get the listtemplate in use
>Look up the .ListTemplates(1).ListLevels(3).NumberFormat
>Each level is then repp'd by %1.%2.%3 for eg.
>
>
>
>Steve Hudson - Word Heretic
>Want a hyperlinked index? S/W R&D? See WordHeretic.com
>
>steve from wordheretic.com (Email replies require payment)
>
>
>Rusty reckoned:
>
>>Thanks for that suggestion.
>>
>>On reflection, I could have asked my question a little
>>more clearly.
>>
>>What I want to know is, using VBA, how can you extract
>>from a nominated heading style whether that heading
level
>>is set to have the numbers of preceding heading levels
>>added to it.
>>
>>That is, what is the setting that specifies that the
>>Heading 2 style should include the number of the Heading
1
>>style? This isn't a particular number or a numbering
style
>>but a Yes or No to include numbering from a previous
level.
>>
>>The Microsoft advice on equivalent Wordbasic - VBA
>>functions says that you should use "ListGalleries
>>(WdListGalleryType).ListTemplates(num).ListLevels(num)"
in
>>place of the old Wordbasic FormatHeadingNumber command
but
>>I can't see how it can provide what I want.
>>
>>Cheers.
>>
>>>-----Original Message-----
>>>G'day "Rusty" <anonymous@discussions.microsoft.com>,
>>>
>>>Try mucking around with .Range.ListFormat.ListString
and
>>friends.
>>>
>>>
>>>Steve Hudson - Word Heretic
>>>Want a hyperlinked index? S/W R&D? See WordHeretic.com
>>>
>>>steve from wordheretic.com (Email replies require
payment)
>>>
>>>
>>>Rusty reckoned:
>>>
>>>>I used to have some very useful WordBasic macros that
I
>>am
>>>>now in the process of converting to VBA. Most of the
>>code
>>>>converts to VBA well but I am stumped with how to get
>>the
>>>>setting for including the number of the previous
heading
>>>>level for a nominated built-in heading style.
>>>>
>>>>For example, if the Heading1 style uses Arabic
numbering
>>>>(e.g. 1, 2, 3), I want to be able to determine whether
>>the
>>>>Heading2 style is set include the number of the
Heading1
>>>>style in its numbering (e.g. 1.1, 1.2, 1.3, 2.1, 2.2,
>>2.3).
>>>>
>>>>This was done with the Include parameter in Wordbasic.
>>The
>>>>converted (to VBA) code looks like thisL
>>>>
>>>>'Get include value from H2
>>>>Dim FHN As Object: Set FHN =
>>>>WordBasic.DialogRecord.FormatHeadingNumber(False)
>>>>FHN.Level = 2
>>>>WordBasic.CurValues.FormatHeadingNumber FHN
>>>>H2IncludePreviousNumber = FHN.include
>>>>
>>>>'Set include value for H2
>>>>WordBasic.FormatHeadingNumber
>>>>include:=H2IncludePreviousNumber
>>>>
>>>>Interestingly, while I cannot retrieve the include
value
>>>>I can set it using the above method.
>>>>
>>>>I am quite happy to relinquish the old Wordbasic code
>>but
>>>>I cannot for the life of me find out how to do what I
>>want
>>>>with VBA.
>>>>
>>>>All suggestions gratefully accepted.
>>>
>>>.
>>>
>
>.
>



Relevant Pages

  • Re: Advice on Template Numbering Scheme
    ... I believe it is possible to restart numbering with ... > an unnumbered style, as that is the whole premise of the List Number 0 ... so you can't have Heading styles in two different list ... > It should be possible to set up two list templates, ...
    (microsoft.public.word.numbering)
  • Re: Changing Outline Numbering Styles
    ... styles and/or the underlying list templates; ... Are you saying that you want to modify the font of the headings or just the ... The above code assumes that we are talking about the built-in heading styles ... with built-in headings linked to the numbering levels. ...
    (microsoft.public.word.vba.general)
  • Re: Advice on Template Numbering Scheme
    ... Heading 2 ... It should be possible to set up two list templates, ... a single list template and manually add the numbering to the top-level ... Numbering will not restart after an outline style with ...
    (microsoft.public.word.numbering)
  • Re: Numbering for Appendix
    ... been a professional writer since 1973, and a technical writer since 1986. ... Users cannot distinguish more than four levels of numbering: ... So your Subheadings become Heading 1's. ... Microsoft MVP, ...
    (microsoft.public.word.numbering)
  • Re: Numbering for Appendix
    ... Users cannot distinguish more than four levels of numbering: ... So your Subheadings become Heading 1's. ... Microsoft MVP, ... Consultant Technical Writer ...
    (microsoft.public.word.numbering)