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

Re: Word vba issue by macropod

macropod
Tue Jun 06 16:15:51 CDT 2006

Hi tope12,

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

Cheers
--
macropod
[MVP - Microsoft Word]


"tope12" <tope12@discussions.microsoft.com> wrote in message
news:2973FD51-D13D-4740-9AFF-834BCEA3B439@microsoft.com...
> 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