B
bilisa
Does anybody know how to search and replace inside a textbox in a Word
document with VBA? Something like this
Set myRange = ActiveDocument.Range(Start:=0, End:=0)
With myRange.Find
.ClearFormatting
.Text = "hello"
With .Replacement
.ClearFormatting
.Text = hello.Value 'a textbox value from a userform
End With
.Execute Replace:=wdReplaceAll, _
Format:=True, MatchCase:=True, _
MatchWholeWord:=True
End With
document with VBA? Something like this
Set myRange = ActiveDocument.Range(Start:=0, End:=0)
With myRange.Find
.ClearFormatting
.Text = "hello"
With .Replacement
.ClearFormatting
.Text = hello.Value 'a textbox value from a userform
End With
.Execute Replace:=wdReplaceAll, _
Format:=True, MatchCase:=True, _
MatchWholeWord:=True
End With