Re: Retrieving Previous Level Number from heading style
From: Rusty (anonymous_at_discussions.microsoft.com)
Date: 02/23/04
- Next message: Mark: "Printing problem !"
- Previous message: Peter Hewett: "Re: Rewrite word document"
- In reply to: Word Heretic: "Re: Retrieving Previous Level Number from heading style"
- Messages sorted by: [ date ] [ thread ]
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.
>>>
>>>.
>>>
>
>.
>
- Next message: Mark: "Printing problem !"
- Previous message: Peter Hewett: "Re: Rewrite word document"
- In reply to: Word Heretic: "Re: Retrieving Previous Level Number from heading style"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|