Fraction Formatting

D

Dean Harvey

Word version 2.0 had a mechanism for installing formatting
of fractions in an acceptable way via Edit/Glossary etc.
For instance you could install 3/4 or sa y 2/3 in a
fraction format that looked and printed as one would
expect, not like I have just printed which is pretty crude!
All you had to do was designate a function key to click
after typing 2/3, 3/4, 7/8 etc and it all happened. Can I
do the same thing with fractions in Word 2002 or are we
going backwards - no help in HELP or the Microsoft Word
2002 book "Inside Out" (1136 pages!).
 
G

Greg Maxey

Dean,

The skinny on fractions is here:

http://www.mvps.org/word/FAQs/Formatting/CreateFraction.htm

If you want to go with the EQ field, you can assign the following macro that
I cobbled together to a keystroke to gather the inputs and generate the
field. I am not very handy with VBA and a expert may come along to provide
so tips for cleaning up the code. Still it works.



Public Sub Fraction()



Dim Num As String

Dim Den As String

Num = InputBox("Enter numerator:", "Numerator")

If Num <> "" Then

Den:

Den = InputBox("Enter denominator:", "Denominator")

If Den = "0" Then

MsgBox "Denominator cannot be a null value.", , "Illogical expression"

GoTo Den

Else

If Den <> "" Then

ActiveDocument.Fields.Add Range:=Selection.Range, _

Type:=wdFieldEmpty, _

Text:="EQ \f(" & Num & ", " & Den & " )", _

PreserveFormatting:=False

End If

End If

End If

End Sub


--
\\\\///////////
( @ @ )
----oo00---(_)---00oo----
Greg Maxey
A peer in "peer to peer" support
Rockledge, FL
 

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