#1
|
|||
|
|||
Field Code: Page number for current StyleRef
I have a document where I want to show a 'Continued' statement in the header for each instance of a specific style (e.g. Header), but I only want to show it if the section under this header style goes to a second page. The style itself is set to have a page break before, so I won't have to worry about having multiple instances on the same page.
Is there a way to tell which page the styleRef started on? The PageRef field code works with Bookmarks, not Styles. If not, is there another way to only show this on subsequent pages? The only other way I can think of to do this would be to use a section break, but I am trying not to go that route. |
#2
|
|||
|
|||
My go-to on the StyleRef Field is Useful StyleRef tricks by Suzanne Barnhill, MVP.
As far as I know, there is no page switch. By using a second style that holds a page field it should be possible to do an IF field and make the "continued" appear. Would you want to do that? It is a bit fussy for setup and it would require knowledge and care in editing. |
#3
|
|||
|
|||
Quote:
The original plan was to have the field code in the header expand on the subsequent pages so that the StyleRef would then be in the same location as the original styled text on the first page (similar to a header row of a table repeating on each page). If I can’t get something like this to work, they may have to settle with the text repeating at the top of every page, without the “continued” text. |
#4
|
|||
|
|||
When asking questions in forums like this it always helps to state the purpose or goal of what you are attempting. Word has many tools and the one you thing should work may not be the one you need.
Start each chapter with an odd-page or next-page section break. Set your headers and footers to have a different first page. Only put the StyleRef field in the primary header. You may have to copy things from your primary header and footer into the first-page header/footer. Header/Footer Settings Recap |
#5
|
||||
|
||||
Cosmo
There isn't a simple solution to this problem. As Charles says, the least tricky way to set this up is to use section breaks. Anything else will require your users to do specific, odd things to achieve the aims. The only way I can think of doing this with StyleRef is to make use of the \l switch and include two instances of the same style on that first page. You could then code a field like {If {StyleRef "Heading 1"}={StyleRef "Heading 1" \l} " continued" ""} On a page where the two paragraphs with the same style appear, you see nothing but on subsequent pages you would see the continued. However, it gets trickier... In order to see the 'first' paragraph instance on subsequent pages, you would need to involve 2 styles by applying a Character style to the heading and then somewhere below that. Say you have created a Character style with no attributes and then apply that to your heading and the following paragraph. You could then use this nested field. {If {StyleRef "Emphasis"}={StyleRef "Emphasis" \l} "{StyleRef "Heading 1"} continued" "{StyleRef "Heading 1"}"} It would then be a case of teaching your users to apply this character style over the top of their headings and a trailing paragraph (which must appear on the same page). In my mind, this is probably a harder sell than getting them to add sections breaks.
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Word 2016: How do I change a REF field code to display a reference to a Roman number as Arabic | Peggy Sue | Word | 1 | 08-15-2017 09:50 PM |
StyleRef field shows <> | Stoic | Word | 2 | 04-20-2017 04:42 AM |
How do I create a field that will return the current paragraph number minus one in an automatic list | gugootz | Word | 1 | 11-23-2015 04:58 PM |
Version number from document filename via field code | palanski | Word | 3 | 10-15-2014 01:54 PM |
StyleRef field | Ulodesk | Word | 4 | 03-21-2012 11:15 AM |