Is it possible to "upline" text in Word 97????

  • Thread starter Thread starter Jim
  • Start date Start date
J

Jim

Im trying to "upline" some words in my document, I mean,
instead of putting a line under the text (this can be
easily done), putting a line ABOVE it. I dont know if MS
Office 97 has this option... Can you help me with that?
Thank you very much.
 
You can use an EQ field. Do the following:

1. Type CTRL+F9; Word inserts field delimiters, {}.

2. Within the delimiters, type EQ \x \to (Text here). In other words,
your field looks like this:

{ EQ \x \to (Text here.) }

3. Finally, click SHIFT+F9 to toggle field code display.
 
Hi Jim

If you need to do this frequently here's a macro that will overline the selected text:

Public Sub Overline()
Dim rngTextToOverline As Word.Range
Dim fldNew As Word.Field
Dim strText As String
Dim strCode As String
Dim lngTextLen As Long

' If the selection object is not a block of text
' select all text to the left until we hit a space
Set rngTextToOverline = Selection.Range
If Selection.Type = wdSelectionIP Then
rngTextToOverline.MoveStart wdWord, -1
End If

strText = rngTextToOverline.Text
lngTextLen = Len(strText)
If lngTextLen = 0 Then Exit Sub

' Build the equation field
strCode = "EQ \o(" & strText & "," & String$(lngTextLen, 175) & ")"
Set fldNew = Selection.Fields.Add(rngTextToOverline, wdFieldEmpty, _
"", False)

' Do it this way otherwise the space normally present before the "}"
' causes Word to display an extra space after the overlined word
fldNew.Code.TextRetrievalMode.IncludeFieldCodes = True
fldNew.Code.Text = strCode
fldNew.Code.TextRetrievalMode.IncludeFieldCodes = False
End Sub

To make the macro easily accessible just add a button for it to a toolbar.

There's a small gotcha with this code. It adds an overline character for every character
selected. This may result in the overline being longer than the text. This is because
the fonts are proportional so "iiiiiiiiii" is shorter than "wwwwwwwwww" but the length of
each overline is the same.

HTH + Cheers - Peter

Im trying to "upline" some words in my document, I mean,
instead of putting a line under the text (this can be
easily done), putting a line ABOVE it. I dont know if MS
Office 97 has this option... Can you help me with that?
Thank you very much.

HTH + Cheers - Peter
 

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

Back
Top