Display all the fractions in the same shape

  • Thread starter Thread starter Jose
  • Start date Start date
J

Jose

Hello!
I work with Word 2000. When I type the fraction "1/4" Word autocorrects it
and displays it as a fraction in a small form. But when I type for example
"4/7" it does not autocorrect it. Is it possible to display all the
fractions in this small form? I have to write some of them and I would like
to display them in this way. Thanks in advance.
 
Autocorrect substitutes a font character with the required fraction so you
would need a font with all the fraction characters used for it to work in
exactly the same way, however, you can achieve something similar - see
http://word.mvps.org/FAQs/Formatting/CreateFraction.htm

or you could try the following macro
Select the fraction in the format 2/7 and run the macro. This should work
with any fraction.

Sub FmtFraction()
Dim OrigFrac As String
Dim Numerator As String, Denominator As String
Dim NewSlashChar As String
Dim SlashPos As Integer
NewSlashChar = "/"
OrigFrac = Selection
SlashPos = InStr(OrigFrac, "/")
Numerator = Left(OrigFrac, SlashPos - 1)
Denominator = Right(OrigFrac, Len(OrigFrac) - SlashPos)
Selection.Font.Superscript = True
Selection.TypeText Text:=Numerator
Selection.Font.Superscript = False
Selection.TypeText Text:=NewSlashChar
Selection.Font.Subscript = True
Selection.TypeText Text:=Denominator
Selection.Font.Subscript = False
End Sub


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

Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 
As a small finishing touch, you could replace the line
NewSlashChar = "/"
with
NewSlashChar = ChrW(&H2044)

U+2044 is the "fraction slash". It's available in Arial, Times New Roman,
Courier New. In smaller fonts it won't be available, though.
This character and the "division slash" U+2215 are tilted more than the
regular slash.

Greetings,
Klaus
 

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

Similar Threads


Back
Top