View Single Post
 
Old 10-12-2021, 07:00 PM
amenoire amenoire is offline Windows 10 Office 2019
Novice
 
Join Date: Oct 2021
Posts: 1
amenoire is on a distinguished road
Default

Hey RAFCRIK,

I came upon this thread also looking for an answer to this kind of problem, and in the mean-time have happened upon a solution. I know it's been a while since you asked, but if it's not helpful for you hopefully it will be to somebody else.


Background:
In my document's header, I am using {styleref} fields to print '{Heading 1}: {Heading 2}'. I also wanted this to display heading information for the text at the top of the page, but this was problematic for me because the heading text was generally on the previous page. Fortunately, the style of my document was similar to that which Charles had suggested above, and for the 'Heading 1' style, each was preceded by a page break. The trouble I had was specifically with 'Heading 2'.

On each page where there is no new text in the 'Heading 1' or 'Heading 2' styles, Word will search back up the document (like we want it to!), finding the previous instance and referencing that. For me, this meant the field {Heading 1} was always correct, but {Heading 2} was incorrect, unless it happened to begin at the top of the page.


Solution:
Immediately before every new 'Heading 2' style, I added a {Heading 2} field, and then applied the 'Heading 2' style to it. Word searches the current page (importantly: above the field) for the 'Heading 2' style. Because it doesn't appear on this page yet (remember: this is before the next 'Heading 2' instance), Word keeps searching up to the previous page, finding the last instance of 'Heading 2' on the previous page (or, presumably, earlier? This was not an issue for me as I have level two headings on every page, just not always at the start of the page).

Once the preceding heading is in place, you want to make it 'invisible'. Because you can't use the 'hidden' text feature, I simply changed the font size to 1, and font colour to white. To keep consistency in formatting, I have inserted this tiny white text above all of my headings that aren't at the top of the next page (this ensures there's not a spacing difference).

Hope this helps!


Examples:
Imagine the text at the top of my page belongs to a heading called 'Heading 1.1' So at the top of my page I want it to show that. Below that text, Heading 1.2 begins, however, so the header is instead referencing that text.

At the beginning, my page initially looks like this...

------- top of page -------

HEADING 1.2 {‘Heading 1’}

------ end of header ------

amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

HEADING 1.2
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

------- end of page -------


Note: The {} after text indicate that text has been called by the field.


After step one, my page now looks like this...

------- top of page -------

HEADING 1.1 {‘Heading 1’}

------ end of header ------

amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

HEADING 1.1 {‘Heading 1’}
HEADING 1.2
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

------- end of page -------



After step two, my page now looks like this... (On a white background, you can't see the heading text)

------- top of page -------

HEADING 1.1 {‘Heading 1’}

------ end of header ------

amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

HEADING 1.1 {‘Heading 1’}
HEADING 1.2
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

------- end of page -------
Reply With Quote