Thanks for this. I'm sure many users will find it useful.
-- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit.
<jon.hertzig[ at ]gmail.com> wrote in message news:1158898504.338260.28240[ at ]m73g2000cwd.googlegroups.com...
[Quoted Text] > that last conditional should have had "Heading 3" instead of "Heading > 1" at the end (so it's saying, if the first heading it finds starting > its search from the current page is a level 3 heading, then show > "Heading 1 (num & text) > Heading 2 (num & txt) > Heading 3 (num & > txt)" do this for every level, and add the HeadChar to a random > paragraph on the opening pages before the first H1 appears to suppress > the breadcrumbs on those pages. > > > jon.hertzig[ at ]gmail.com wrote: > > > Just want to toot my own horn ... been wrastling with a problem that > > was reported in several outdated posts: how to get a header to show > > "breadcrumbs" in a complex document, eg so that it says "Heading 1 > > > Heading 2 > Heading 3 ..." for whatever's on the current page (I have > > a document with 8 levels of header and was wanting to show the > > navigation on each page). > > > > The problem is that the Styleref field searches for the first occurence > > of a style (eg, Heading) up or down in the entire document, not just > > the current page. So if you are on a page that only goes up to H3, it > > would include the H4 from several pages hence in the document. There's > > no way to use the PageRef or other fields to pick up the page number of > > the StyleRef that it finds... but here's how I solved it: > > > > Creating a character style that has no attributes, HeadChar, and > > applying it with global search-replace to all headings. Then searching > > for the first 'HeadChar' from the bottom up (\l), and if it matches a > > style level, insert that style with all the previous levels. So, for > > example, for level 3: {IF {STYLEREF "Heading 3" \n \l} = {STYLEREF > > "HeadChar" \n \l} "{STYLEREF "Heading 1" \n \l} {STYLEREF "Heading 1" > > \p \l} > {STYLEREF "Heading 2" \n \l} {STYLEREF "Heading 2" \p \l} > > > {STYLEREF "Heading 1" \n \l} {STYLEREF "Heading 1" \p \l}" } > > > > It works! >
|