Customized page numbers in footer (harvested from text)

R

RickR

I need to add custom page numbers to the footer of each page of a Wor
2010 document. The custom page number will be harvested from one or mor
occurrences of the snippets "[Page xx]" appearing within the text on th
page: For example, say "[Page 88]" and "[Page 89]" are found within th
text appearing on a given page (separated by a few lines of text). Fro
these, I will then place "88-89" in the footer for that page. (Th
customized numbers therefore have nothing to do with the actual pag
numbers of the document.) The fields should populate when the documen
is opened. I understand rudimentary VBS macro programming, how to inser
fields, etc. Thank you very much
 
S

Stefan Blom

You should be able to use STYLEREF fields for this. Create two unique
character styles and apply one of them to the "88" and the other one to "89"
(and similarly, using the same pair of styles, for other pages in the
document). In the footer, add { STYLEREF "Name of first char style" }–{
STYLEREF "Name of second style" }.

You can insert the field codes via Insert tab | Quick Parts | Field.
Alternatively, you can insert them manually: Press Ctrl+F9 to insert each
pair of field delimiters, { }, and then type in the code as shown above.

-- 
Stefan Blom
Microsoft Word MVP




---------------------------------------------
"RickR" wrote in message

I need to add custom page numbers to the footer of each page of a Word
2010 document. The custom page number will be harvested from one or more
occurrences of the snippets "[Page xx]" appearing within the text on the
page: For example, say "[Page 88]" and "[Page 89]" are found within the
text appearing on a given page (separated by a few lines of text). From
these, I will then place "88-89" in the footer for that page. (The
customized numbers therefore have nothing to do with the actual page
numbers of the document.) The fields should populate when the document
is opened. I understand rudimentary VBS macro programming, how to insert
fields, etc. Thank you very much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top