C
cyberdude
Hi,
I used the following subroutine to replace some text appearing in a
document, which is the same as that held by TextBox1, by the text held
in TextBox3.
With doc_range.Find
.Text = TextBox1
.Font.Color = wdColorRed
.Replacement.Text = TextBox3
.Replacement.Font.Color = wdColorBlack
.Execute Replace:=wdReplaceAll
End With
For example, I want to replace boy_name in a document, then I'll put
boy_name in TextBox1 in a userform and put the replacement text in
Textbox3. After the replacement, all boy_name(s) in the active
document will be replaced. But, today, a error message showed up
saying that the replacement text, which is the text in TextBox3, is
too long. Can someone tell me how to overcome this problem? Thanks.
Mike
I used the following subroutine to replace some text appearing in a
document, which is the same as that held by TextBox1, by the text held
in TextBox3.
With doc_range.Find
.Text = TextBox1
.Font.Color = wdColorRed
.Replacement.Text = TextBox3
.Replacement.Font.Color = wdColorBlack
.Execute Replace:=wdReplaceAll
End With
For example, I want to replace boy_name in a document, then I'll put
boy_name in TextBox1 in a userform and put the replacement text in
Textbox3. After the replacement, all boy_name(s) in the active
document will be replaced. But, today, a error message showed up
saying that the replacement text, which is the text in TextBox3, is
too long. Can someone tell me how to overcome this problem? Thanks.
Mike