I get !Syntax Error, { for a formula using {PAGE}

P

Pat

I'm trying to have a page number only for odd pages. I tried entering a field
code of:

{ = ({ PAGE } / 2) + 0.5 }

however I always get the error:

!Syntax Error, {

Even if I enter a simple formula like:

{ = {PAGE} + 1 }

produces the same error. If I use simple numbers, no problem. If I remove
the curly brackets from {PAGE} I get a bookmark error. I tried every
combination of including spaces I could think of and I get the same error. I
copied and pasted a Microsoft example verbatim and I get the same error. It
definitely does not like the { in my formula. What am I doing wrong?

Thanks!
 
G

Greg Maxey

Pat,

You don't need VBA or a macro for this. You have to enter the field code
braces { } enclosing your formula and enclosing the text PAGE with CTRL+F9
 
D

Doug Robbins

Assuming that you are wanting to set up two "pages" per sheet, I think that
the formulae that you really need is

{ = ({ Page } * 2 ) - 1 }

for the odd numbered "pages" and

{ = { Page } * 2 }

for the even numbered pages

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

Jonathan West

Hi Pat,

Go to File, Page Setup, click on the Layout tab and check the "Different odd
and even pages"

You will now have separate headers & footers for odd & even pages, and can
just put a PAGE field in the odd page footer

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 
P

Pat

Thanks to all who replied. Unfortunately I failed to be clear and for that I
am truly sorry.

I get an error. That was my original point. I did all the things you all
suggested before I posted my message, but it remains, I get an error. Why do
I get the error?

I'm trying to create an instructor guide for training, where the left side
page has no page number, and the right hand side does, therefore the odd
pages of the document would count page 1,2,3,4 for physical pages 1,3,5,7 and
that is why I am trying { = ({PAGE} / 2) + 0.5 } so that 1 / 2 + 0.5 = 1, 3/2
+ 0.5 = 2, etc.

However when I enter the above formula field code, or any field code that
contains a variable within a curly bracket such as {PAGE} or {NUMPAGES}, I
get the following error:

!Syntax Error, {

Is there something wrong with my syntax?

If I enter { = ( 1 / 2 ) + 0.5 } then the field code appropriately
calculates 1 for the page number. As soon as I introduce a {PAGE} into the
code, I get the error.
 
D

Doug Robbins

You must use Ctrl+F9 to insert the field delimiters. They look like curly
brackets, but they are not.

However, if you use an Odd Page header as Jonathon suggested, you can just
have the page numbers display on that header without the need for any
arithmetic.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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