Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 04-26-2021, 06:46 AM
RRB's Avatar
RRB RRB is offline Chapters in Headers Windows 8 Chapters in Headers Office 2013
Susan Flamingo
Chapters in Headers
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 249
RRB is on a distinguished road
Default Chapters in Headers

Hi Friends!



I have a page that has, say, on that page, chapters 1,2,3.

I want the header to reflect that.

So I created a style called "ChapterNo" and formated the Chapter No. using that style and then used the field in the header "Style Ref"

Works fine. But it only gets the text for the first instance of that style, so it reads just:

"Chap 1"

What can I do on a page that has, say, Chap 1,2,3 on that page, and I want the header to read:

"Chap 1-3" (starting from the first chapter on that page and ending with the last)

TIA

Susan Flamingo
Etc.
Reply With Quote
  #2  
Old 04-26-2021, 11:07 AM
Charles Kenyon Charles Kenyon is offline Chapters in Headers Windows 10 Chapters in Headers Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,083
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

Hi Susan,


The StyleRef Field only will reflect a singe instance of the style. However you can have multiple fields and they can pick up the last entry instead of the first.
Use the \l switch in one field to pick up the last entry.
Reply With Quote
  #3  
Old 04-26-2021, 11:24 AM
RRB's Avatar
RRB RRB is offline Chapters in Headers Windows 8 Chapters in Headers Office 2013
Susan Flamingo
Chapters in Headers
 
Join Date: May 2014
Location: The Holy City of Jerusalem
Posts: 249
RRB is on a distinguished road
Default

Ok, I think I understand.

Question if I may:

If I have two instances of the style:

1. "Chap 1"
2. "Chap 2"

So in the heading, I know how to insert two fields one without the switch you mentioned and one with that switch, and that would give me:

"Chap 1 Chap 2"

But if I have two instances of the style:

1. "Chap 1"
2. " Chap 1"

I DONT want it to read "Chap 1 Chap 1"

Just "Chap 1"

So I want Word to check: If the text of the last instance is *identical* to the text of the first instance, just show the first instance.

Can it be done?

Thank You for your help

Susan
Reply With Quote
  #4  
Old 04-26-2021, 03:06 PM
Charles Kenyon Charles Kenyon is offline Chapters in Headers Windows 10 Chapters in Headers Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,083
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

First consider doing:
{ StyleRef "Heading 1" } - { StyleRef "Heading 1" \l }
or
{ StyleRef "Heading 1" } through { StyleRef "Heading 1" \l }


Then you get:
"Chap 1 - Chap 2" or "Chap 1 through Chap 2"
"Chap 1 - Chap 1" or "Chap 1 through Chap 1"
which does not look as confusing.
Reply With Quote
  #5  
Old 04-26-2021, 03:08 PM
Charles Kenyon Charles Kenyon is offline Chapters in Headers Windows 10 Chapters in Headers Office 2019
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,083
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

You can use an IF Field to compare the two.
Code:
{ IF { StyleRef "Heading 1" } <> { StyleRef "Heading 1" \l } { StyleRef "Heading 1" \l } }

That would be used instead of just the { StyleRef "Heading 1" \l }
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapters in Headers Headers & Footers for Chapters LewM Word 3 11-09-2018 07:28 AM
Chapters in Headers Need VBA to renumber chapters bobbyrjw Word VBA 3 01-03-2017 12:15 AM
How to number chapters and sub-chapters in a few clicks? Icelandic_Boy Word 1 05-24-2016 11:33 AM
Chapters in Headers Chapters only Table of Contents SQLUSA Word 2 07-04-2012 03:36 PM
Page numbering - Chapters Andrew Thorpe Word 0 08-04-2010 11:04 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:11 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