TButhe
03-15-2005, 02:00 PM
Hi everyone,
I have a form that has several (41 to be exact) text form fields in a table. They want them to be spell checked. I cannot figure out the code to spell check a form field. I have used bookmarks for each text field but when i reference the bookmark it just rifles thru each text field and doesn't bring up the Spelling and Grammar dialog box. The code below is just a small part of my macro. I'm sure there is a quicker and better way to do this but I am just a beginner. :bink: I have repeated the two "Selection" lines for each of the numerous text boxes and have assigned the macro to a toolbar button.
Private Sub ChkSpl()
ActiveDocument.Unprotect
Selection.GoTo What:=wdGoToBookmark, Name:="Text1"
Selection.Range.CheckSpelling
Selection.GoTo What:=wdGoToBookmark, Name:="Text2"
Selection.Range.CheckSpelling
End Sub
I have had success with similar code but I was pulling it from a user form to a bookmark. I am not allowed to alter the appearance of the form that this needs to go into so cannot change the layout, etc. I also cannot attach a copy of the form because it would be considered confidential. :whyme:
I did look at the KB and dug thru all the posts but couldn't find anything. Am I going about this wrong?:aw
Thanks for your assistance!!
I have a form that has several (41 to be exact) text form fields in a table. They want them to be spell checked. I cannot figure out the code to spell check a form field. I have used bookmarks for each text field but when i reference the bookmark it just rifles thru each text field and doesn't bring up the Spelling and Grammar dialog box. The code below is just a small part of my macro. I'm sure there is a quicker and better way to do this but I am just a beginner. :bink: I have repeated the two "Selection" lines for each of the numerous text boxes and have assigned the macro to a toolbar button.
Private Sub ChkSpl()
ActiveDocument.Unprotect
Selection.GoTo What:=wdGoToBookmark, Name:="Text1"
Selection.Range.CheckSpelling
Selection.GoTo What:=wdGoToBookmark, Name:="Text2"
Selection.Range.CheckSpelling
End Sub
I have had success with similar code but I was pulling it from a user form to a bookmark. I am not allowed to alter the appearance of the form that this needs to go into so cannot change the layout, etc. I also cannot attach a copy of the form because it would be considered confidential. :whyme:
I did look at the KB and dug thru all the posts but couldn't find anything. Am I going about this wrong?:aw
Thanks for your assistance!!