Nayasoch
Board Regular
- Joined
- Sep 9, 2016
- Messages
- 73
Hello guys I need help with Ms word, where I have entire paragraph....I am looking for any vba code to add ** before and after each bold letter...so far I have
It keeps on adding asterik....only on first bold letter and looping withitself....dosen't move to next one ( keeps repeating itself) and doesn't add ** after bold letter only before... Any help would be much appreciated.
Rich (BB code):
Sum AsteriskText()
Dim keepSearch As Boolean
keepSearch = False
Selection.Tables(1).Columns(3).Select
Do
Selection.Find.ClearFormatting
Selection.Find.Font.Bold = True
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
If Selection.Find.Found Then
keepSearch = True
Else
keepSearch = False
End If
With Selection
.InsertBefore "**"
End With
Loop While keepSearch
End Sub
It keeps on adding asterik....only on first bold letter and looping withitself....dosen't move to next one ( keeps repeating itself) and doesn't add ** after bold letter only before... Any help would be much appreciated.