PDA

View Full Version : Solved: Find/Replace in Form Field Help Text



Anne Troy
07-22-2004, 02:42 PM
We've misspelled THAT in our help text in a gazillion form fields. Anybody got some code that will find and replace it for us??

We misspelled it as THART.

:)

ALaRiva
07-22-2004, 05:13 PM
Are all of the forms fields in one document?

Anne Troy
07-22-2004, 05:16 PM
yep :)

ALaRiva
07-22-2004, 05:30 PM
I'm no Word Pro (like you!), But this worked!


Dim frmfld As FormField

For Each frmfld In Me.FormFields

frmfld.Result = Replace(frmfld.Result, " THART ", " that ", , , vbTextCompare)

Next frmfld

Anne Troy
07-22-2004, 06:02 PM
Well, it sure LOOKED good. :)
But it didn't change anything. It's in the HELP TEXT of the form fields, not in the form fields.

:)
Really looked cool, tho.

I actually ran this:

Option Explicit
Sub FixThart()
Dim frmfld As FormField

For Each frmfld In Me.FormFields

frmfld.Result = Replace(frmfld.Result, " THART ", " that ", , , vbTextCompare)

Next frmfld


End Sub

ALaRiva
07-22-2004, 08:09 PM
OK, I missed the whole Help Text in the first post. Try this:


Dim frmfld As FormField

For Each frmfld In Me.FormFields

frmfld.HelpText = Replace(frmfld.HelpText, " THART ", " that ", , , vbTextCompare)

Next frmfld

Anne Troy
07-22-2004, 09:22 PM
:beat Loverly!!

ALaRiva
07-22-2004, 09:23 PM
:beat Loverly!!
You know it!