Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-13-2020, 02:42 PM
Cosmo Cosmo is offline Field Code: Page number for current StyleRef Windows Vista Field Code: Page number for current StyleRef Office 2007
Competent Performer
Field Code: Page number for current StyleRef
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default 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.
Reply With Quote
  #2  
Old 11-13-2020, 06:42 PM
Charles Kenyon Charles Kenyon is online now Field Code: Page number for current StyleRef Windows 10 Field Code: Page number for current StyleRef Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,082
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

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.
Reply With Quote
  #3  
Old 11-14-2020, 06:39 AM
Cosmo Cosmo is offline Field Code: Page number for current StyleRef Windows Vista Field Code: Page number for current StyleRef Office 2007
Competent Performer
Field Code: Page number for current StyleRef
 
Join Date: Mar 2012
Posts: 240
Cosmo is on a distinguished road
Default

Quote:
Originally Posted by Charles Kenyon View Post
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.
I’m not quite sure I understand, but it doesn’t sound like this will work for me. This is for a template I’m setting up for our account executives to use, so it needs to be automatic and foolproof; if it requires any action on their end then it won’t work.

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.
Reply With Quote
  #4  
Old 11-14-2020, 11:23 AM
Charles Kenyon Charles Kenyon is online now Field Code: Page number for current StyleRef Windows 10 Field Code: Page number for current StyleRef Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,082
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

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
Reply With Quote
  #5  
Old 11-15-2020, 03:54 PM
Guessed's Avatar
Guessed Guessed is offline Field Code: Page number for current StyleRef Windows 10 Field Code: Page number for current StyleRef Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
Reply

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
Field Code: Page number for current StyleRef 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
Field Code: Page number for current StyleRef Version number from document filename via field code palanski Word 3 10-15-2014 01:54 PM
Field Code: Page number for current StyleRef StyleRef field Ulodesk Word 4 03-21-2012 11:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:27 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft