Results 1 to 3 of 3

Thread: Word 98 Mac

  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Fontana, California, USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word 98 Mac

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

  2. #2
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word 98 Mac

    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:

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


    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.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Fontana, California, USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Word 98 Mac

    Thank you sooooo much - have a great day.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •