Find (w/format) but replace (w/o format)

S

Sharon

I want to find a word that is superscript and replace it with a word that is
not superscript, but the "no formatting" button is greyed out after I put the
superscript for the find word. Can anyone help?
 
S

Stefan Blom

With the insertion point in the "Replace with" box, click Format, and then
click Font. First click "Superscript" to select and "activate" that option
(the check mark will be greyed out at first), and then clear the option
again. When you click OK and return to the dialog box, you will see "Not
Superscript/ Subscript" listed at "Format" below the "Replace with" box. You
should now be able to perform the find and replace operation.
 
D

dOinK

In Word 2007 you may just un-select Superscript. I'm not sure how this is
done in version 2003.

dOinK
 
G

Graham Mayor

From the replace function
Find 'word' - format font superscript (check the superscript check box in
the font dialog)
replace with
^&
format font not superscript/subscript (uncheck the superscript) check box in
the font dialog

CTRL+Shift+ '+' with the cursor in the find or replace boxes will toggle
through the superscript options.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Sharon

It works great, but I guess I should have told you that I am trying to put
this in a macro. Basically, I have a huge document with references, i.e.,
(1), (2), (3), etc. with endnotes that show the full cite. I want to
activate a macro that will change (1) to (Jones, 2008), which is the short
cite. Sorry, I thought it would work the same when I tried to record the
macro. Any suggestions?
 
G

Graham Mayor

The macro recorder will not record formatting, but you can use something
similar to the following
The macro uses 2 arrays for the find and replacement texts. Each array here
has four entries in quotes separated by commas.
The superscripted item in the first array is replaced by the
mon-superscripted corresponding item in the second array

Sub ReplaceExample()
Dim vFindText As Variant
Dim vReplText As Variant
Dim i As Long

vFindText = Array("(1)", "(2)", "(3)", "(4)")
vReplText = Array("(Jones, 2008)", "(Smith, 2007)", "(Bloggs, 2005)",
"(Jones, 2009)")
With Selection
.HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
'**********************
.Font.Superscript = True
.Replacement.Font.Superscript = False
'**********************
.Forward = True
.Wrap = wdFindContinue
.format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = False
.Execute Replace:=wdReplaceAll
For i = LBound(vFindText) To UBound(vFindText)
.Text = vFindText(i)
.Replacement.Text = vReplText(i)
.Execute Replace:=wdReplaceAll
Next i
End With
End With
End Sub

http://www.gmayor.com/installing_macro.htm


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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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