A family of Microsoft word processing software products for creating web, email, and print documents.
Time to adopt the metric system.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hey there. Not looking for an existing solution but rather, I am making a suggestion for a problem that has no satisfactory solution (that I'm aware of). I'm a cabinet maker and I routinely create long lists, in Word, of dimensions that contain fractions. For instance "One cabinet door 24 1/2" x 11 9/16". When I create this in Word the program auto-corrects the 1/2 to a stylized font, while the 9/16 remains formatted as you see it now on this screen. (Go try now and see!) Now, I'm aware that I can Insert the various elements to make a stylized fraction from the Character Map but that is slow and clunky. I want the auto-correct to occur WHILE TYPING. I also understand that in Options there is a way to enable this feature but it only performs this for the most common fractions. In Cabinetry we deal in lots of fractions like 13/16, etc, which the formatting does not correct. It is possible that my research missed a way to perform this, and if so it'd be nice if you could point the way. However, if I'm right and there is no built-in solution, it'd be awesome if you folks could create something. Cheers!
A family of Microsoft word processing software products for creating web, email, and print documents.
Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.
Time to adopt the metric system.
You are right that it has long been a problem.
See: Creating Fractions by Suzanne Barnhill, MVP.
I long ago decided to add AutoCorrect entries for the ones that I use and turn off the AutoFormat as you type entry for fractions (so they all look the same). I use a combination of superscript for the denominator and subscript for the numerator. These are separated by a slash. They are stored as formatted AutoCorrect. Other methods of creating them are discussed in Suzanne's article.
Turn off the ones in AutoFormat as you type...
I used Jay Freedman's AutoCorrect2007 utility to make a backup of my fraction entries. You are welcome to try it.
Here is a link to that backup document with the supplemental fractions.
You would use it as a Restore source for Jay' utility and it would add the fractions shown in it to your AutoCorrect.
Jay's Utility can be found on his Download page.
I make a backup of my AutoCorrect any time I add something that takes a fair amount of work or every six months or so.
If you want to use one of the other methods for constructing Fractions set forth in Suzanne's page, you could do so and paste them into the Fractions document I produced and then run Jay's utility with that.
A final note, my method using superscripted/subscripted characters works fine for me because I do not use single-spaced documents. See the note in Suzanne's article about spacing.
I have my spacing set at Multiple 1.08 and the fractions created this way do not cause a problem. With single spacing you would need to use Exact spacing and it might end up cutting off characters.
[Edit: macropod is correct that if you regularly write dates with only month and day, or month and year with a slash, this method will provide some surprises, that can be undone with Ctrl+Z if you notice in time. The same can be said of AutoFormat as you type with certain dates. His macros are more flexible than preparing AutoCorrect entries in advance.]
Just make sure to use the Fraction Slash (U2044) rather than the generic forward slash.
I long ago decided to add AutoCorrect entries for the ones that I use and turn off the AutoFormat as you type entry for fractions (so they all look the same).
One thing to watch out for when using AutoCorrect is that dates entered as D/M without the year might also get reformatted...
For a macro solution that solicits the fraction for formatting as you input it, try:
Sub EnterFraction()
'Add this macro to your Normal.dot
'Assign a keystroke like Alt-/ to this macro (Tools...Customize...Keyboard)
'Prompt user for the text to format as a fraction
fraction = InputBox("Enter fraction text (ex: 1/2, 5/32)")
'Find the position of the slash in the text
slashPosition = InStr(fraction, "/")
'Quit if no slash in the text
If slashPosition = 0 Then Exit Sub
preSlash = Left(fraction, slashPosition - 1)
postSlash = Right(fraction, Len(fraction) - slashPosition)
With Selection
.Font.Size = .Font.Size * 0.875
'Type text before the slash as superscript
.Font.Superscript = True
.TypeText preSlash
'Type the slash as normal text
.Font.Superscript = False
.TypeText "/"
'Format text after the slash
.Font.Subscript = True
.TypeText postSlash
'Continue with font back to normal
.Font.Subscript = False
End With
End Sub
or:
Sub MakeFraction()
Dim Fraction As String, Numerator As String, Denominator As String
ActiveWindow.View.ShowFieldCodes = True
With Selection
' For user input, you could use the following 2 lines to create a fraction
Fraction = InputBox("Please input the Fraction (ex: 1/2, 5/32)")
.Collapse (wdCollapseStart)
' Alternatively, to convert a selection, use the following line
'Fraction = Trim(.Text)
Numerator = Split(Fraction, "/")(0)
Denominator = Split(Fraction, "/")(1)
.Font.Size = Round(.Font.Size) / 2
.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False, Text:="EQ \f(" & Numerator & "," & Denominator & ")"
.MoveLeft wdCharacter, 2
.Delete
.Fields.Update
End With
ActiveWindow.View.ShowFieldCodes = False
End Sub
The first of these simply takes an input string and reformats it, whilst the second employs an EQ field to deliver a comparable result, but formatted with a horizontal line between the numerator and denominator. The latter can even do the same with text strings.
And, finally, here’s a macro with which you simply type your fraction into the document, select the fraction and run the macro - a process that can also be used for any existing fractions you might have.
Sub Fraction()
Dim RngTmp As Range, StrFrac
With Selection
StrFrac = Split(Selection.Text, "/")
Set RngTmp = .Range
With RngTmp
.Font.Size = .Font.Size * 0.875
.End = .Start + Len(StrFrac(0))
.Font.Superscript = True
.Characters.Last.Next.Font.Italic = True
.End = .End + 2 + Len(StrFrac(1))
.Start = .End - Len(StrFrac(1)) - 1
.Font.Subscript = True
End With
End With
Set RngTmp = Nothing
End Sub