Hi WoodOne,
actually, I've tried to address Jay Freedman.
But since you are writing,
I'll play around a bit with auto correct
but I don't have the time or patience to write
a line of code everytime I need a fraction.
But thanks for the input--it keeps me on
top of just how much I need to learn. !!!
I think, you might still be interested,
and not know yet, how simple it can be.
Sure, only in a way. ;-)
There was I time, when I didn't know
how to insert a floppy disc ito a disc drive.
You need to know nothing about programming,
therefore there are no comments in the code.
Get to the VBA-Editor: [alt F11].
Copy the code from the posting into it.
Close it. Assign a shortcut to "Fractions",
by the menu "Tools", "Customize".
Click on "Keyboard".
Select "Macros" in the left listbox.
Select "Fractions" in the right listbox.
Click in "Press new shortcut key".
Press e.g. [F12]. Click "assign".
....
You will have to press F12 every now and then.
Maybe there is someone around, to help you,
with the VBA-Editor and assigning a shortcut.
Sub Fractions()
Dim l As Long
Dim p As Long
Dim rDcm As Range
Set rDcm = ActiveDocument.Range
Dim h As Long
h = Selection.Start
ResetSearch
With rDcm.Find
.Text = "[0-9]{1,}/[0-9]{1,}"
.MatchWildcards = True
While .Execute
If rDcm.Next <> "/" Then
p = InStr(rDcm.Text, "/")
l = Len(rDcm.Text)
rDcm.End = rDcm.Start + p - 1
rDcm.Select
rDcm.Font.Size = 8
rDcm.Font.Position = 3
rDcm.Start = rDcm.Start + p
rDcm.End = rDcm.End + l - p
rDcm.Select
rDcm.Font.Size = 8
rDcm.Collapse Direction:=wdCollapseEnd
End If
Wend
End With
ResetSearch
ActiveDocument.Characters(h).Select
Selection.Collapse Direction:=wdCollapseEnd
End Sub
' ---
Public Sub ResetSearch()
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
End Sub
Don't give up.
--
Greetings from a bavarian hobby woodworker
Helmut Weber, MVP WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"