Hi
I have created the following very basic macro to add non bold quotes around bold phraseswithin a selection.
My problem is, that if there is a bold space after the phrase. Is there a way to remove the bold space, but not between bold words. I hope that makes sense.
Sub AddQuotestoSelection()
'to stop people not selecting
If Selection.Range.Start = Selection.Range.End Then
MsgBox "Remember to select the paragraphs first!"
Exit Sub
End If
'adds speechmarks around any bold text
Selection.Find.ClearFormatting
Selection.Find.font.Bold = True
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = ""
.Replacement.Text = ChrW(8220) & "^&" & ChrW(8221)
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'replaces bold speechmarks with non bold speechmarks
Selection.Find.ClearFormatting
Selection.Find.font.Bold = True
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.font.Bold = False
With Selection.Find
.Text = """"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub