Word vba issue

T

tope12

I made two textboxes in a Microsoft Word document. They're called text2 and
text3. When I click on text3. I wanted a word to appear in text 3 if text2
contained a certain string, but it doesn't work.

Private Sub text3_click()
If text2 = "john" Then
text3 = "Doe"
End If
End Sub
 
M

macropod

Hi tope12,

Try:
ActiveDocument.Bookmarks("Text3").Range.Fields(1).Result.Text = "Doe"

Cheers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top