View Single Post
 
Old 08-26-2020, 02:02 PM
RAFCRIK RAFCRIK is offline Windows 10 Office 2016
Novice
 
Join Date: Aug 2020
Posts: 6
RAFCRIK is on a distinguished road
Default Use StyleRef based on previous page - IF this-and-that

Hello,

My apologies in advance for being yet another noob who abuses this forum for his own problems... I really have practically no knowledge of Visual Basic or the "Fields" of Word. But I do have a project in which they (hopefully) offer the grail to my quest.

Here are the variables of what I want to achieve:
  • I only need it in the header of certain (luckily succeeding each other) sections (so maybe using placeholders like £ and µ might help?)
  • If the first line of the page is in style "Kop 1;REGEL;Rule" OR in style "Kop 2;SECTIE;Section":
    £ should be { STYLEREF "Kop 2;SECTIE;Section" \n \t \* MERGEFORMAT }.
    µ should be { STYLEREF "Kop 2;SECTIE;Section" \* MERGEFORMAT }.
  • If the first line of the page is in neither style "Kop 1;REGEL;Rule" nor "Kop 2;SECTIE;Section":
    £ should be { STYLEREF "Kop 2;SECTIE;Section" \l \n \t \* MERGEFORMAT } of the previous page.
    µ should be { STYLEREF "Kop 2;SECTIE;Section" \l \* MERGEFORMAT } of the previous page.
In essence, it's a header like in a dictionary: not the next "title", but the one to which the first line of the page belongs.

Do you see any possibility to make this magic happen?

Thanks in advance for your help!
Reply With Quote