Microsoft KB Archive/105862: Difference between revisions

From BetaArchive Wiki
(importing KB archive)
 
m (Text replacement - """ to """)
 
Line 33: Line 33:
   GoToNextSection            GoToPreviousSection
   GoToNextSection            GoToPreviousSection
   GoToNextSubdocument        GoToPreviousSubdocument </pre>
   GoToNextSubdocument        GoToPreviousSubdocument </pre>
This article supplements the information in online Help. To open this Help topic in Word for Windows, click Contents on the Help menu and then choose the &quot;Programming with Microsoft Word&quot; topic. In Word for the Macintosh, click the Help icon and select Microsoft Word Help. Choose the &quot;Programming with Microsoft Word&quot; topic.
This article supplements the information in online Help. To open this Help topic in Word for Windows, click Contents on the Help menu and then choose the "Programming with Microsoft Word" topic. In Word for the Macintosh, click the Help icon and select Microsoft Word Help. Choose the "Programming with Microsoft Word" topic.


<br />
<br />
Line 40: Line 40:
== MORE INFORMATION ==
== MORE INFORMATION ==


The commands listed in the &quot;Summary&quot; section of this article are single line commands. They have no arguments and are used to move to specified parts of the document.
The commands listed in the "Summary" section of this article are single line commands. They have no arguments and are used to move to specified parts of the document.


=== Example ===
=== Example ===
Line 47: Line 47:


<pre class="CODESAMP">  Sub MAIN
<pre class="CODESAMP">  Sub MAIN
       Begin Dialog UserDialog 225, 146, &quot;Goto&quot;
       Begin Dialog UserDialog 225, 146, "Goto"
       OKButton 36, 118, 88, 21
       OKButton 36, 118, 88, 21
       CancelButton 129, 119, 88, 21
       CancelButton 129, 119, 88, 21
       OptionGroup  .HelpChoice
       OptionGroup  .HelpChoice
         OptionButton 12, 6, 180, 16, &quot;Next Annotation&quot;, .OptionButton1
         OptionButton 12, 6, 180, 16, "Next Annotation", .OptionButton1
         OptionButton 12, 23, 180, 16, &quot;Next Endnote&quot;, .OptionButton2
         OptionButton 12, 23, 180, 16, "Next Endnote", .OptionButton2
         OptionButton 12, 40, 180, 16, &quot;Next Footnote&quot;, .OptionButton3
         OptionButton 12, 40, 180, 16, "Next Footnote", .OptionButton3
         OptionButton 12, 57, 180, 16, &quot;Next Page&quot;, .OptionButton4
         OptionButton 12, 57, 180, 16, "Next Page", .OptionButton4
         OptionButton 12, 74, 127, 16, &quot;Next Section&quot;, .OptionButton5
         OptionButton 12, 74, 127, 16, "Next Section", .OptionButton5
         OptionButton 12, 91, 172, 16, &quot;Next Subdocument&quot;,
         OptionButton 12, 91, 172, 16, "Next Subdocument",
       .OptionButton6
       .OptionButton6
       End Dialog
       End Dialog

Latest revision as of 09:57, 20 July 2020

WD: WordBasic Examples: GotoNext/GotoPrevious

Q105862



The information in this article applies to:


  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows NT, version 6.0
  • Microsoft Word for Windows, versions 7.0, 7.0a
  • Microsoft Word for the Macintosh, versions 6.0, 6.0.1





SUMMARY

This article contains a sample macro that demonstrates the use of the following WordBasic statements or functions:

   GoToNextAnnotation         GoToPreviousAnnotation
   GoToNextEndnote            GoToPreviousEndnote
   GoToNextFootnote           GoToPreviousFootnote
   GoToNextPage               GoToPreviousPage
   GoToNextSection            GoToPreviousSection
   GoToNextSubdocument        GoToPreviousSubdocument 

This article supplements the information in online Help. To open this Help topic in Word for Windows, click Contents on the Help menu and then choose the "Programming with Microsoft Word" topic. In Word for the Macintosh, click the Help icon and select Microsoft Word Help. Choose the "Programming with Microsoft Word" topic.



MORE INFORMATION

The commands listed in the "Summary" section of this article are single line commands. They have no arguments and are used to move to specified parts of the document.

Example

The macro below could be used to go to different parts of the active document. In all instances the GoToNextCommand could be replaced with GoToPreviousCommand. If the item selected to go to does not exist, the insertion point will not move.

   Sub MAIN
      Begin Dialog UserDialog 225, 146, "Goto"
      OKButton 36, 118, 88, 21
      CancelButton 129, 119, 88, 21
      OptionGroup  .HelpChoice
         OptionButton 12, 6, 180, 16, "Next Annotation", .OptionButton1
         OptionButton 12, 23, 180, 16, "Next Endnote", .OptionButton2
         OptionButton 12, 40, 180, 16, "Next Footnote", .OptionButton3
         OptionButton 12, 57, 180, 16, "Next Page", .OptionButton4
         OptionButton 12, 74, 127, 16, "Next Section", .OptionButton5
         OptionButton 12, 91, 172, 16, "Next Subdocument",
      .OptionButton6
      End Dialog
      Dim dlg As UserDialog
      GetCurValues dlg
      n = Dialog(dlg)
      If n = 0 Then Goto bye
      Select Case dlg.HelpChoice
         Case 0
            GoToNextAnnotation         ' Any of the above commands would
         Case 1                        ' work inserted here.
            GoToNextEndnote
         Case 2
            GoToNextFootnote
         Case 3
            GoToNextPage
         Case 4
            GoToNextSection
         Case 5
            GoToNextSubdocument
      End Select
   bye:
   End Sub 

Additional query words:

Keywords : kbprg kbdtacode wordnt kbmacroexample winword ntword macword word6 word7 word95
Issue type : kbhowto
Technology :


Last Reviewed: November 4, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.