Z
Zeljko
I need to find ALL ocurances of word "Name:" or "Adress: A" or ... in that
*.doc and then boldit complete row where is that word.
Problem is that with this code it only bold rows where it finds first
ocurances of word "Name:" or "Adress: A" or ...
I try everything and i can't find solution. Plese help if u can.
To start macro i call procedure Replace_Bold
I have next code:
Sub DoFindBold(FindText As String)
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = FindText
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
If Selection.Find.Found Then
Selection.HomeKey Unit:=wdLine
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.Font.Bold = wdToggle
Selection.Find.Execute
Else
Selection.Find.Execute
End If
End Sub
///// and another one
Sub Replace_Bold()
Call DoFindBold("Name:")
Call DoFindBold("Adress: A")
' ... line call continues ca. 150 times ...
End Sub
*.doc and then boldit complete row where is that word.
Problem is that with this code it only bold rows where it finds first
ocurances of word "Name:" or "Adress: A" or ...
I try everything and i can't find solution. Plese help if u can.
To start macro i call procedure Replace_Bold
I have next code:
Sub DoFindBold(FindText As String)
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = FindText
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.MatchCase = True
.MatchWholeWord = True
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
If Selection.Find.Found Then
Selection.HomeKey Unit:=wdLine
Selection.MoveDown Unit:=wdLine, Count:=1, Extend:=wdExtend
Selection.Font.Bold = wdToggle
Selection.Find.Execute
Else
Selection.Find.Execute
End If
End Sub
///// and another one
Sub Replace_Bold()
Call DoFindBold("Name:")
Call DoFindBold("Adress: A")
' ... line call continues ca. 150 times ...
End Sub