Find Replace bold formatting with delimiter

S

Steve

Hi,



I have paragraphs whose first couple of words are in bold and represent
titles of magazines and then immediately following a description of the
magazine in plain text. I would like to parse these into separate fields by
placing a delimiter between the bold text and plain and then doing a Text to
Columns in Excel. So, if I used the ampersand '@' as a delimiter I would
like to do the following:



Before Find Replace

<bold>Interior Design<bold>A magazine on the interior design industry.



After Find Replace

<bold>Interior Design<bold>@A magazine on the interior design industry.



It doesn't matter if the title remains bold so long as a delimiter is placed
between it and the description.



Thanks - Steve
 
G

Greg Maxey

Steve,

First stab would be Edit>Replace>More. Put your cursor in the find what
field then click format>font>bold. Put your cursor in the replace with
field and enter ^&@.

This will give you <bold>Title<bold>@ Description.

If you want you could then find @space and replace with @, leaving you with
<bold>Title<bold>@Description
 
G

Guest

Hi Steve,
if there is no other bold text, then

Sub Makro3()
Dim rDcm As Range
Set rDcm = ActiveDocument.Range
ResetSearch
With rDcm.Find
.Font.Bold = True
.Replacement.Text = "^&@" '!
.MatchWildcards = True
.Execute Replace:=wdReplaceAll
End With
ResetSearch
End Sub

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

Greetings from Bavaria, Germany
Helmut Weber, MVP WordVBA
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
 
S

Suzanne S. Barnhill

As a shortcut, you can just press Ctrl+B in the (empty) "Find what" box to
apply Format: Font: Bold.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
S

Steve

Thank you!

So ^& was the secret to all this, although Helmut's more general solution
deserves accolades.
 
S

Suzanne S. Barnhill

There are a number of shortcuts that work this way: Ctrl+B, Ctrl+I,
Ctrl+Shift+H, Ctrl+J/L,R,E (basically most of the shortcuts for font and
paragraph formatting), as well as Ctrl+Spacebar and Ctrl+Q (to remove any of
the previous). The font formatting ones are three-way toggles. Ctrl+B once
gives you Format: Font: Bold. Twice gives you Format: Font: Not Bold. A
third time (or Ctrl+Spacebar) cancels the formatting.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
K

Klaus Linke

....with the added bonus that you can selectively find stuff that you can't
enter in the dialog (say "Bold, Not italic" = Ctrl+B, Ctrl+I, Ctrl+I).

Regards,
Klaus
 

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

Similar Threads


Top