• Word 98 Mac

    Author
    Topic
    #352703

    Help! Can I, and if I can, how do I do it – require an entry into a text form box by a user.

    Viewing 0 reply threads
    Author
    Replies
    • #513803

      Hi,

      Assume your form textbox is called “Text2”, and that there is a form textbox immediately before it called “Text1”- then set up this macro:

      Sub ValidateText2
      If Trim$(ActiveDocument.FormFields("Text2").Result) = "" Then
        MsgBox "must be entered"
        ActiveDocument.FormFields("Text1").Select
        SendKeys "{tab}"
      End If
      End Sub
      

      then, double click on “Text1”, and select “ValidateText2” from the dropdown “Macro on exit”.

      The reasons for selecting Text1 in the code, and then using SendKeys, is that if you Select Text2, when you finish the macro, it selects the next form field in sequence, rather than staying where you’ve told it.

    Viewing 0 reply threads
    Reply To: Word 98 Mac

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: