Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Steve
 
Posts: n/a
Default MS WORD setting the tab order using a single onexit macro

Hello,

Is it possible to assign a single onexit macro for various formfields using
the following code?


Sub TabOrder()

Dim StrCurFFld As String, StrFFldToGoTo As String

'First get the name of the current formfield
If Selection.FormFields.Count = 1 Then
'No textbox but a check- or listbox
StrCurFFld = Selection.FormFields(1).Name
ElseIf Selection.FormFields.Count = 0 And Selection.Bookmarks.Count 0 Then
'Textbox
StrCurFFld = Selection.Bookmarks(Selection.Bookmarks.Count).Nam e
End If

'Then find out which formfield to go to next ...
Select Case StrCurFFld
Case "Dropdown1"
StrFFldToGoTo = "Dropdown2"
Case "Dropdown2"
StrFFldToGoTo = "Dropdown3"
Case "Dropdown3"
StrFFldToGoTo = "Text1"
End Select
'... and go to it.
ActiveDocument.Bookmarks(StrFFldToGoTo).Range.Fiel ds(1).Result.Select

End Sub
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting WordPerfect 12 files to Word 2003 Curious New Users 4 May 19th 23 02:48 PM
Reveal codes in a word document FUN101 Microsoft Word Help 4 May 16th 23 08:47 PM
Word should allow to 'divide' page by 3 or 4, not just 2 CandasK Page Layout 2 February 28th 06 10:16 PM
Macros - Keyboard Commands Janet Microsoft Word Help 6 April 11th 05 05:28 AM
In Word, how can I see all files (*.*) in "save as"? citizen53 New Users 8 April 4th 05 04:56 PM


All times are GMT +1. The time now is 09:29 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"