Results 1 to 14 of 14

Thread: TabOrder macro

  1. #1
    Lounger
    Join Date
    Mar 2001
    Location
    Carlsbad, California, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    TabOrder macro

    Hello. Having a problem with a template in Word 2000. The form has several fields at the top for fill-in, then the lower half of the document is formatted text. The lower half can't be in a field itself, because of the formatting. I've inserted a bookmark "begin_text" at this point, intending to send the cursor there when the user finished the last field in the upper half.

    Tried both of the TabOrder macros from the Knowledgebase -- but they still send the user back to the first field of the upper half, instead of to the bookmark "begin_text." (I have protected for forms, BTW, and included the macro in the "on exit" box.)

    Q - how do I modify the TabOrder macro to do this? Keep in mind I'm completely illiterate when in comes to VB, but I can follow directions. [img]/w3timages/icons/clever.gif[/img]

    Thanks for your help.

    Kathleen

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: TabOrder macro

    Hi Kathleen,

    You don't say specifically, but is it correct to assume that you've already put a continuous section break between the two parts, and have applied forms protection only to the first section? And I guess the flip side of this question is, if you have protection applied to the entire document, why do you need to direct the user down to the bottom half, where there are no fields?

    If you do the above, you don't even need to run any special macro, as the insertion point will automatically jump from the last form field in the protection section, to the beginning of the unprotected section when you tab out of the last form field.

    Hope this helps,
    Gary

  3. #3
    Lounger
    Join Date
    Mar 2001
    Location
    Carlsbad, California, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TabOrder macro

    Gary,

    Yes, I had tried the section break -- though it took me a while to get there! :-) If I let the insertion point just jump, it won't be in the place where the text needs to continue. As it is, they will have to cursor or mouse down to the right spot. Perhaps I'm being picky, but I did want it to be neat.

    Also, I would really like to know why the GoTo won't work.

    Thanks for the reply, it does help to know I was on the right track.

    Kathleen

  4. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: TabOrder macro

    Hi again,

    I noticed that too - before posting my first message, I tried writing a macro to GoTo a specific bookmark in the unprotected portion of the document, and I made this macro the OnExit macro of the last formfield.

    But the cursor still insisted on jumping to the start of the unprotected section, rather than the bookmark - weird!

  5. #5
    Lounger
    Join Date
    Mar 2001
    Location
    Carlsbad, California, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TabOrder macro

    Hi Gary,

    Yes, I thought it was weird, too! I hate letting stuff like this go without making it work, but I'm stuck, so the rough version will have to do.

    Thanks for your input.

    Kathleen

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

    Re: TabOrder macro

    Kathleen,

    There seems to be something with formfields, that after the "On exit" macro is processed, it then executes the "tab" key which was pressed to exit the form field (or something like that).

    A combination of a goto and a sendkeys may work. If, for instance, the last bookmark before the section break is "Text4", then this works for me:

    ActiveDocument.FormFields("Text4").Select
    SendKeys "{tab}"

    BTW, I assume one of your microsoft knowledge base artices you mentioned was <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q120/4/47.ASP>this one</A>
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  7. #7
    Lounger
    Join Date
    Mar 2001
    Location
    Carlsbad, California, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TabOrder macro

    Geoff,

    Sorry, you've lost me. [img]/w3timages/icons/frown.gif[/img] I'm afraid my only experience with macros was in WP 5.1 -- a completely different animal!

    The KB article is similar, but for Word 97: <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q159/8/96.asp>http://support.microsoft.com/support/kb/ar...s/Q159/8/96.asp</A>

    The macro is this one, modified with my bookmarks (I've already deleted mine):

    Sub TabOrder()
    Dim sTabTo As String
    Dim dlgForm As Dialog
    Set dlgForm = Dialogs(wdDialogFormFieldOptions)
    Select Case LCase(dlgForm.Name)
    Case "cc"
    sTabTo = "header"
    Case "header"
    sTabTo = "to"
    Case "to"
    sTabTo = "from"
    Case "from"
    sTabTo = "memo"
    Case "memo"
    sTabTo = "subject"
    Case "subject"
    sTabTo = "cc"
    Case Else
    End Select
    ActiveDocument.Bookmarks(sTabTo).Select
    End Sub

    Not quite sure where you would change this, or how your change would get me to my "begintext" bookmark, which is (now) in the unprotected part of the document.

    Thanks,

    Kathleen

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

    Re: TabOrder macro

    Kathleen,

    I've attached something which I think is what you want, which is different from what I thought you wanted before. I might still be off track, of course.

    It looks as if any document positioning info from the macro is ignored when the macro finishes- it then goes on the do the repositioning it was going to do anyway.

    This one uses "sendkeys" to send a Control+End to the document- it doesn't go to the bookmark. (Sendkeys seems to execute after the macro has finished).

    I played around with having a separate macro which was executed by an Alt+G keyboard shortcut, but that didn't help.
    Attached Files Attached Files
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

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

    Re: TabOrder macro

    Here's another way to do it- it might work better.

    I've put a dummy form field after the subject field. There's no "on exit" macros- just an "on entry" macro in the new dummy field.
    Attached Files Attached Files
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  10. #10
    Lounger
    Join Date
    Mar 2001
    Location
    Carlsbad, California, USA
    Posts
    27
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TabOrder macro

    Geoff,

    Thanks! That does what I need it to. Sometimes simple is better, huh?

    Kathleen

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

    Re: TabOrder macro

    Kathleen,

    The KISS pricciple (Keep It Simple, Stupid).

    Gald it helped.

    Geoff
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  12. #12
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TabOrder macro

    Hi Geoff:

    I tried to download your attachment to take a look at it. I received a template, but when I opened it, it was just gibberish. I'm using Word 2000. Have any idea what happened?

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

    Re: TabOrder macro

    Phil,

    I've no idea what happened to the attachment.

    But basically, instead of trying to play around with "on exit" macros, I just placed a dummy form field after the last form field, before the section break. I put an "on entry" macro into that dummy form field- a one line macro to transfer control to the middle of another section.

    Another point I thought of later. I've sometimes had form fields which I want to execute down one column, then start at the top of the next column. Instead of "on exit" processing there, I've put the columns as cells in a table (eg, 2 columns, 1 row)- one column in one cell, and the next column in cell 2. That gives me the tab order without any programming.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  14. #14
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: TabOrder macro

    Hi Geoff:

    Thanks for the info. I've got it now & it does work (although it looks a little funny because I have form shading set to always). I'm going to see if I can find any info on the on exit macros; it sure seems like it should go from the last field to a bookmark in the non protected part of the document.

    Cheers,

Posting Permissions

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