page numbers, multiple docs

G

Guest

I need to automate my page numbering. I am using separate documents, not a
Master/Sub document format.

I came across a field commnad to automate this based on a hidden page field
bookmarked as LastPage in the previous document as follows:
{ = { PAGE } + { INCLUDETEXT "[document]" LastPage
\* CharFormat \! } }

I have placed this formula in my footer, replacing "document" with the path
for the previous doc, starting with C:/etc and ending in .doc

I keep getting a syntax error. All suggestions gratfully received...
 
S

Stefan Blom

The INCLUDETEXT field requires double backslashes in paths. For
example:

{ INCLUDETEXT "C:\\my folder\\another folder\\my file.doc" }

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 
S

Stefan Blom

in message
HI Stefan

Thanks for your help - its been a long night for me (Irish time).. I am
still getting syntax error My field now reads as follows:
= { PAGE } + { INCLUDETEXT "C:\\Documents and Settings\\Owner\\Desktop\\Jan
9\\1. Executive Summary.doc" LastPage \* MERGEFORMAT

Verify that the path is correct, that the bookmark name is correct,
and that the bookmark actually includes nothing more than a number.

--
Stefan Blom
Microsoft Word MVP


What I am doing wrong??

Stefan Blom said:
The INCLUDETEXT field requires double backslashes in paths. For
example:

{ INCLUDETEXT "C:\\my folder\\another folder\\my file.doc" }

--
Stefan Blom
Microsoft Word MVP


in message
I need to automate my page numbering. I am using separate
documents,
not a
Master/Sub document format.

I came across a field commnad to automate this based on a hidden page field
bookmarked as LastPage in the previous document as follows:
{ = { PAGE } + { INCLUDETEXT "[document]" LastPage
\* CharFormat \! } }

I have placed this formula in my footer, replacing "document"
with
the path
for the previous doc, starting with C:/etc and ending in .doc

I keep getting a syntax error. All suggestions gratfully received...
 
G

Graham Mayor

What does { INCLUDETEXT "C:\\Documents and Settings\\Owner\\Desktop\\Jan
9\\1. Executive Summary.doc" LastPage} produce when inserted? If not a
number this will not work.

In the Executive Summary.Doc insert the following fields

{SET LastPage {Numpages}}

Your calculated field will then only contain the last page number of that
document
so your new calculation should work. The Mergeformat bit isn't required. All
field brackets are entered with CTRL+F9

{= { PAGE } + { INCLUDETEXT "C:\\Documents and Settings\\Owner\\Desktop\\Jan
9\\1. Executive Summary.doc" LastPage}


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Stefan said:
in message
HI Stefan

Thanks for your help - its been a long night for me (Irish time).. I
am still getting syntax error My field now reads as follows:
= { PAGE } + { INCLUDETEXT "C:\\Documents and
Settings\\Owner\\Desktop\\Jan 9\\1. Executive Summary.doc" LastPage
\* MERGEFORMAT

Verify that the path is correct, that the bookmark name is correct,
and that the bookmark actually includes nothing more than a number.

What I am doing wrong??

Stefan Blom said:
The INCLUDETEXT field requires double backslashes in paths. For
example:

{ INCLUDETEXT "C:\\my folder\\another folder\\my file.doc" }

--
Stefan Blom
Microsoft Word MVP


in message
I need to automate my page numbering. I am using separate
documents, not a Master/Sub document format.

I came across a field commnad to automate this based on a hidden
page field bookmarked as LastPage in the previous document as
follows: { = { PAGE } + { INCLUDETEXT "[document]" LastPage
\* CharFormat \! } }

I have placed this formula in my footer, replacing "document" with
the path for the previous doc, starting with C:/etc and ending in
.doc

I keep getting a syntax error. All suggestions gratfully
received...
 
S

Stefan Blom

Create a test document and see what, if anything, the INCLUDETEXT
field displays here. Then try adding the other components of the
nested field and see where things go wrong. When you've got everything
working, you can copy the field into the document where it actually
"belongs."

Alternatively, see if Graham's solution works better.

--
Stefan Blom
Microsoft Word MVP


in message
 
G

Graham Mayor

This error means that you have entered the field boundaries {} from the
keyboard and not by using CTRL+F9

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

You cannot copy and paste fields.

In the Executive Summary.doc document Place your cursor anywhere in that
document - start or end would be best and press CTRL+F9 (together)
You should see two bold brackets {}
between them type SET LastPage
immediately after press CTRL+F9 again for the second pair of brackets.
Between them type NumPages
You should now have

{SET LastPage {Numpages}}

Press F9 (to update that field and then if necessary ALT+F9 to toggle the
display - that field will 'disappear'.
Save the document.
In your other document - presumably in the footer -
Enter in the same way directly in the document - this time with three sets
of brackets provided by CTRL+F9
{= { PAGE } + { INCLUDETEXT "C:\\Documents and Settings\\Owner\\Desktop\\Jan
9\\1. Executive Summary.doc" LastPage}
F9 then ALT+F9 to display the calculated result.

I'm curious about your psuedonym, for as coincidence would have it I have
just booked my passage on Irish Ferries for an Easter visit to Dublin - if
British Airways don't screw up the connecting flight:)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


Irish said:
HI Graham

Welcome to the party..

Sorry to be pedantic, but could you walk me through in baby steps how
to insert a field. I am doing something wrong that I cannot see.

Insert - Field...-FieldCode tab - opens with =
I tried to copy and paste the field code {SET LastPage {Numpages}}
after the =, but Syntax error again

When do I use the Ctrl F9 function? It does not seem to be responding
What does { INCLUDETEXT "C:\\Documents and
Settings\\Owner\\Desktop\\Jan 9\\1. Executive Summary.doc" LastPage}
produce when inserted? If not a number this will not work.

In the Executive Summary.Doc insert the following fields

{SET LastPage {Numpages}}

Your calculated field will then only contain the last page number of
that document
so your new calculation should work. The Mergeformat bit isn't
required. All field brackets are entered with CTRL+F9

{= { PAGE } + { INCLUDETEXT "C:\\Documents and
Settings\\Owner\\Desktop\\Jan 9\\1. Executive Summary.doc" LastPage}


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

Stefan said:
in message
HI Stefan

Thanks for your help - its been a long night for me (Irish time)..
I am still getting syntax error My field now reads as follows:
= { PAGE } + { INCLUDETEXT "C:\\Documents and
Settings\\Owner\\Desktop\\Jan 9\\1. Executive Summary.doc" LastPage
\* MERGEFORMAT

Verify that the path is correct, that the bookmark name is correct,
and that the bookmark actually includes nothing more than a number.




What I am doing wrong??

:

The INCLUDETEXT field requires double backslashes in paths. For
example:

{ INCLUDETEXT "C:\\my folder\\another folder\\my file.doc" }

--
Stefan Blom
Microsoft Word MVP


in message
I need to automate my page numbering. I am using separate
documents, not a Master/Sub document format.

I came across a field commnad to automate this based on a hidden
page field bookmarked as LastPage in the previous document as
follows: { = { PAGE } + { INCLUDETEXT "[document]" LastPage
\* CharFormat \! } }

I have placed this formula in my footer, replacing "document"
with the path for the previous doc, starting with C:/etc and
ending in .doc

I keep getting a syntax error. All suggestions gratfully
received...
 
G

Graham Mayor

It seems your second document (the one with the calculation) has page
numbers that do not start at the first page and has section breaks. For the
field to work as you require it has to add the displayed page numbers rather
than the actual page numbers.

You will have to adjust the calculation for each section to take account of
the difference between the perceived page number and the actual page number
eg as the first section varies in length

Page {=({ Page } + ({ NumPages } - { SectionPages }) +{ IncludeText "D:\\My
Documents\\Test\\Versions\\Even\\Doc 1.doc" LastPage } - 1) }

and in the documents with 2 sections that you wish to carry the page number
from, you need to modify the SET field
{ SET LastPage{ = { Numpages } - { SectionPages } } }

The *actual* page number is that displayed in the status bar at the bottom
of the Word window.

While you can get the correct *displayed* page numbers by this method, your
TOCs will show the *actual* page numbers and I don't see any easy solution
to this - apart from not showing page numbers in the TOC. As an Irishman
might have said when asked directions - If I was going there I wouldn't have
started from here ;)

Maybe this is one occasion when risking the master document function could
be an options (but do keep copies or you could lose the lot)
http://word.mvps.org/FAQs/General/WhyMasterDocsCorrupt.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

Irish said:
P.S. I am Irish, I work for Cliffs of Moher Cruises on the west
coast, so our boat is little bit smaller than Irish Ferries!

The Cliffs are one place that will be on my agenda if I have time this trip
;)

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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