Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Pat - 06 Aug 2005 00:30 GMT
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!
Greg Maxey - 06 Aug 2005 00:41 GMT
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

Signature

Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.

> I'm trying to have a page number only for odd pages. I tried entering
> a field code of:
[quoted text clipped - 17 lines]
>
> Thanks!
Doug Robbins - 06 Aug 2005 06:59 GMT
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

Signature

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

> I'm trying to have a page number only for odd pages. I tried entering a
> field
[quoted text clipped - 19 lines]
>
> Thanks!
Jonathan West - 06 Aug 2005 10:36 GMT
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

Signature

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

> I'm trying to have a page number only for odd pages. I tried entering a
> field
[quoted text clipped - 19 lines]
>
> Thanks!
Pat - 08 Aug 2005 17:15 GMT
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.

> Hi Pat,
>
[quoted text clipped - 27 lines]
> >
> > Thanks!
Doug Robbins - 08 Aug 2005 20:32 GMT
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.

Signature

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

> Thanks to all who replied. Unfortunately I failed to be clear and for that
> I
[quoted text clipped - 61 lines]
>> >
>> > Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.