Search and Replace - Bold

T

TimK

Is there a way to find a word or set of words that are
bolded and add the HTML <B> </B> tags around it? I don't
care if the Search and Replace gets rid of the bold
formatting in word, I just want the HTML bold tags to
placed around the word or set of words.

Thanks,
Tim
 
S

Suzanne S. Barnhill

Try this:

1. Leave the "Find what" box empty but press Ctrl+B to get "Format: Bold."

2. In the "Replace with" box, type <B>^&</B>

3. Replace All.

If you want to remove the bold formatting as you replace, press Ctrl+B twice
in the "Replace with" box to get "Format: Not Bold."

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://www.mvps.org/word
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
L

Larry

Tim,

In addition to Suzanne's suggestion, if this is something you're going
to be doing regularly, you may want a macro for it so that you don't
have to set it up manually each time: If you don't know how to install
a macro and assign it to a keystroke or menu button, write back to the
group.


Selection.MoveDown wdLine, 2
With Selection.Find: .ClearFormatting: .Text = "": .Font.Bold = True: _
..Forward = True: .Wrap = wdFindStop
Do While .Execute
With Selection
' retract selection from spaces and punctuation
.MoveEndWhile cset:=" " & "." & "?" & "!" & "," & _
"""", Count:=-6
.InsertBefore "<b>": .InsertAfter "</b>": .MoveRight wdWord, 1: End
With
Loop
End With

Larry
 

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