Microsoft Word Formulas

L

Liam Gibbs

I'm having a real tough time with doing formulas in Microsoft Word
2002. I've even tried using the Microsoft-provided examples, typing
them out word-for-word, but they don't seem to work as explained. When
I try something like { = 19.99 * 10 }, it comes out nothing. If I try
' Page { PAGE } of { = (47 - 1) + { NUMPAGES }', I get '1'. Should I
not get 'Page 1 of 66' or something? Anyway, these formulas are very
difficult for me to understand. What I need to do is take the number
of pages (NUMPAGES, I assume from what the help system tells me,
although I have yet to get a decent number back) and multiply that by
126. Does anybody know how this is done? Is there a decent,
non-Microsoft-written primer on their own formulas?
 
G

Graham Mayor

Fields are quite simple, but to make them easy to work with you should add a
personal toolbar to Word and put on it a couple of buttons to call a pair of
macros:

Sub FieldCodes()
ActiveWindow.View.ShowFieldCodes = Not ActiveWindow.View.ShowFieldCodes
Application.DisplayStatusBar = True
End Sub

(there is a keyboard equivament to this - ALT+F9)

The other is the example code at http://www.gmayor.com/installing_macro.htm
which explains how to add macros
and that macro has keyboard equivalents (CTRL+A then F9, but does not work
when the document has headers with fields)

The step you appear to be missing is the updating of the field

Press CTRL+F9 - this gives you a pair of brackets {}
Between them type = CTRL+F9
so you get {={}}
Between the second pair of brackets type Numpages and outside the bracket
type * 26 thus:

{ ={Numpages} * 26 }

Toggle the display - the field will be blank. Hit F9 or the toolbar button
and the display will show the page number * 26.


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

Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 
D

Dayo Mitchell

Just FYI, I think Tools | Customize, Commands, has a View Field Codes icon
to be put on the toolbar... Does the macro to Show Field Codes do something
different?

DM (MacWord 2001)
 
G

Graham Mayor

I have been known to miss these commands in the past :) This one will do
exactly the same I guess. It simply toggles the display on/off.

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

Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 
D

Dayo Mitchell

Well, I was figuring maybe you've been expert in Fields since before they
added the command to the user interface. :)

Dayo
 
S

Suzanne S. Barnhill

I added that to my toolbar back in the days when for some reason I could
never remember Alt+F9. It's still there and at least serves as a handy
reference to the view state of field codes.
 

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