home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / VISUAL_B / ARQS_ZIP / WBA_HG.ZIP / MACREF.DAT next >
Encoding:
Text File  |  1991-07-31  |  160.7 KB  |  4,087 lines

  1. :Abs()
  2.  
  3. Syntax:  Num = Abs(n) 
  4.  
  5. Returns the unsigned value of n. 
  6.  
  7. Function...Return value 
  8. Abs(5)........5
  9. Abs(-5).......5
  10.  
  11. :Activate
  12.  
  13. Syntax:  Activate WindowText$, [PaneNum]
  14.  
  15. Activates the window whose title bar is specified by WindowText$. If PaneNum is supplied, a value of 1 or 2 activates the top pane and a value of 3 or 4 activates the bottom pane.  (HACKER'S GUIDE ALERT:>WindowText$ ltd to 255 characters) 
  16.  
  17. :AppActivate
  18.  
  19. Syntax:  AppActivate WindowText$, [Immediate]
  20.  
  21. Activates the application whose title bar is specified by WindowText$. If Immediate is 1, Word immediately switches the focus to the other application. If Immediate is 0 (zero), and Word does not have the focus,Word flashes its title bar, waits for the user to give the focus to Word, and then activates the application. 
  22.  
  23. :AppInfo$()
  24. Syntax:  A$ = AppInfo$(TypeOfInfo)
  25.  
  26. Returns information about the state of Word. 
  27.  
  28. Info    Result
  29. -----       ------------
  30.  1    The environment string; for example, "Windows 2.1.1" 
  31.  2    The version number of Word; for example, "1.00"
  32.  3    Word is in a special mode; for example, CopyText or MoveText mode 
  33.  4    X position of the Word window, measured from the left of the screen in points
  34.  5    Y position of the Word window, measured from the top of the screen in points
  35.  6    Width of the current document window in points
  36.  7    Height of the current document window in points
  37.  8    Returns -1 if the application is maximized
  38.  9    Amount of total conventional memory
  39. 10    Amount of total conventional memory available
  40. 11    Amount of total expanded memory
  41. 12    Amount of total expanded memory available
  42. 13    Returns -1 if a math coprocessor is installed
  43. 14    Returns -1 if a mouse is present
  44. 15    Amount of disk space available
  45.  
  46. Values are returned as strings. Use Val(AppInfo$(n)) to convert the string to a number, if appropriate.
  47.  
  48. :AppMaximize
  49.  
  50. Syntax:  AppMaximize 
  51.  
  52. Zooms the Word window to full screen size. 
  53.  
  54. :AppMaximize()
  55.  
  56. Syntax:  Log = AppMaximize()
  57.  
  58. Returns a nonzero value if the window is maximized.
  59.  
  60. :AppMinimize
  61.  
  62. Syntax:  AppMinimize 
  63.  
  64. Minimizes the Word window to an icon. 
  65.  
  66. :AppMinimize() 
  67. Syntax:  Log = AppMinimize()
  68.  
  69. Returns a nonzero value if the window is minimized.
  70.  
  71. :AppMove
  72.  
  73. Syntax:  AppMove XPos, YPos
  74.  
  75. Moves the Word window to XPos, YPos relative to the top left of the screen. Values are in points.
  76.  
  77. AppMove 20, 40
  78.  
  79. Moves the Word window to a position at 20 points right and 40 points down from top-left corner of the screen 
  80.  
  81. :AppRestore
  82.  
  83. Syntax:  AppRestore
  84.  
  85. Restores the Word window from a maximized/minimized state.
  86.  
  87. :AppSize
  88.  
  89. Syntax:  AppSize XPos, YPos
  90.  
  91. Resizes the Word window. Values are in points.
  92.  
  93. :Asc()
  94.  
  95. Syntax:  Num = Asc(A$) 
  96.  
  97. Returns the ANSI character code of the first character in A$.
  98.  
  99. Function              Return value
  100. Print Asc("Sign")       83
  101.  
  102. :Beep  
  103.  
  104. Syntax:  Beep [Beeptype]
  105.  
  106. Causes the computer's speaker to beep. Beeptype is 1, 2, 3, or 4. If Beeptype is omitted, it is assumed to be 1. The exact tone produced will depend on your hardware configuration. A typical use of Beep is to signal the end of a macro.
  107.  
  108. :Begin Dialog
  109.  
  110. Syntax:  Begin Dialog UserDialog [x], [y], dx, dy 
  111.  
  112. Starts the dialog box declaration.  The dx and dy arguments are the width and height of the dialog box (relative to the given x and y coordinates).  If x and y are not supplied, then the dialog box is positioned automatically by Word at the point where dialog boxes usually appear on the screen. 
  113.  
  114. :Bold
  115.  
  116. Syntax:  Bold [On]
  117.  
  118. Without the argument, toggles bold for the entire selection.  If On is nonzero, makes the entire selection bold. If On is 0 (zero), removes bold from the entire selection.
  119.  
  120. :Bold()
  121.  
  122. Syntax:  Num = Bold()
  123.  
  124. Returns 0 (zero) if none of the selection is bold, 1 if all of the selection is bold, or -1 if part of the selection is bold.
  125.  
  126. :BookmarkName$()
  127.  
  128. Syntax:  A$ = BookmarkName$(Count) 
  129.  
  130. Returns the name of the bookmark defined in the given context (global or 
  131. document template). Count must be in the range from 1 to CountBookmarks.  The name is taken from the list in the given context. 
  132.  
  133. :Call
  134.  
  135. Syntax:  [Call] Subname [ParameterList]
  136.  
  137. Transfers control to a subroutine.
  138.  
  139. :Cancel
  140.  
  141. Syntax:  Cancel
  142.  
  143. Terminates a mode such as ColumnSelect and does not perform the action.  See "OK," later in this section.
  144.  
  145. :CancelButton
  146.  
  147. See "OKButton"
  148.  
  149. :Case
  150.  
  151. See "Select Case"
  152.  
  153. :CenterPara
  154.  
  155. Syntax:  CenterPara
  156.  
  157. Centers the currently selected paragraph(s).
  158.  
  159. :CenterPara()
  160.  
  161. Syntax:  Num = CenterPara()
  162.  
  163. Returns 0 (zero) if none of the selected paragraphs are centered, 1 if all of the selected paragraphs are centered, or -1 if more than one kind of paragraph alignment is used. 
  164.  
  165. :ChangeCase
  166.  
  167. Syntax:  ChangeCase [Type]
  168.  
  169. Without an argument, alternates the case of the current selection between all lowercase, all caps, and initial caps based on the first two characters of the selection. If Type is 0 (zero), sets the text to all lowercase. If Type is 1, sets the text to all caps. If Type is 2, sets the text to initial caps. If the selection is an insertion point, Word does not perform an action.
  170.  
  171. Arg    selected text    New text is
  172. -----       ---------------------   ------------------
  173.  0    How many?    how many?
  174.  1    How many?    HOW MANY?
  175.  2    How many?    How Many?
  176. none    How many?    how many?
  177.  
  178. :ChangeRulerMode
  179.  
  180. Syntax:  ChangeRulerMode
  181.  
  182. Cycles the ruler between Paragraph, Table, and Document modes.
  183.  
  184. :CharColor
  185.  
  186. Syntax:  CharColor Color
  187.  
  188. Sets the character color of the selection to Color.  The color may be one of the following:
  189. (Auto means the color specified byt he Control Panel setting).
  190.  
  191. Arg    Description
  192. 0    Auto
  193. 1    Black
  194. 2    Blue
  195. 3    Cyan
  196. 4    Green
  197. 5    Magenta
  198. 6    Red
  199. 7    Yellow
  200. 8    White
  201.  
  202. :CharColor()
  203.  
  204. Syntax:  Num = CharColor() 
  205.  
  206. Returns the numbers set by the CharColor statement, or -1 if all the selected text is not the same color. See CharColor.  
  207.  
  208. :CharLeft
  209.  
  210. Syntax:  CharLeft [Repeat], [Select]
  211.  
  212. Moves the selection left by Repeat characters. If the argument is omitted, 1 is assumed. If Select is nonzero, the selection is extended to the left or right by  Repeat characters.
  213.  
  214. STATEMENT:  CharLeft 5, 1
  215. EFFECT:     Extends the selection five characters to the left of the insertion point
  216.  
  217. :CharlLeft ()
  218.  
  219. Syntax:  Log = CharLeft [Repeat], [Select] 
  220.  
  221. Moves the selection left by Repeat characters. Returns 0 (zero) if the action cannot be performed.
  222.  
  223. :CharRight
  224.  
  225. Syntax:  CharRight [Repeat], [Select]
  226.  
  227. Moves the selection right by Repeat characters. If the Repeat argument is omitted, 1 is assumed. If Select is nonzero, the selection is extended to the right by Repeat characters. If Select is 0 (zero) or omitted, the selection is not extended.
  228.  
  229. STATEMENT: CharRight 10 
  230. EFFECT:    Moves the selection point 10 characters to the right of the insertion point, but does not extend the selection
  231.  
  232. :CharRight ()
  233.  
  234. Syntax:  Log = CharRight [Repeat], [Select]
  235.  
  236. Moves the selection right by Repeat characters. Returns 0 (zero) if the action cannot be performed. 
  237.  
  238. :ChDir
  239.  
  240. Syntax:  ChDir Name$ 
  241.  
  242. Changes directories to the one specified by Name$.  (HACKER'S GUIDE ALERT:>Name$ ltd to 255 characters)
  243.  
  244. :CheckBox
  245.  
  246. Syntax:  CheckBox x, y, dx, dy, Text$, .Field 
  247.  
  248. Creates a check box. When the dialog box is used .Field contains the current setting: if the value is 0, the box is not checked; any other value means the box is checked.  The result is a numeric field with the value 0 (zero) (not checked) or -1 (checked) in the dialog record returned from Dialog.
  249.  
  250. CheckBox 97,54,36,12 "&Bold", .bold
  251.  
  252. :Chr$()
  253.  
  254. Syntax:  A$ = Chr$(n) 
  255.  
  256. Returns the character whose ANSI code is n. 
  257.  
  258. :Close
  259.   
  260. Syntax:  Close [[#]StreamNumber]
  261.  
  262. Closes the file attached to StreamNumber.  If StreamNumber is not supplied, all open files are closed.
  263.  
  264. :ClosePane
  265.  
  266. Syntax:  ClosePane
  267.  
  268. Closes the current window pane. You use this statement to close a pane in a split document, a header/footer pane, a footnote pane, etc. This does not close a document window, only a pane in a window.
  269.  
  270. :CloseUpPara
  271.  
  272. Syntax:  CloseUpPara
  273.  
  274. Makes the space before and after the selected paragraph 0 (zero).
  275.  
  276. :CmpBookmarks()
  277.  
  278. Syntax:  Num = CmpBookmarks(Bookmark1$, Bookmark2$) 
  279.  
  280. Compares two named bookmarks and returns one of the following values:
  281.  
  282. Return.....Meaning
  283.   0    Bookmark1$ and Bookmark2$ are equivalent
  284.   1    Bookmark1$ is entirely below Bookmark2$
  285.   2    Bookmark1$ is entirely above Bookmark2$
  286.   3    Bookmark1$ is below and inside Bookmark2$
  287.   4    Bookmark1$ is inside and above Bookmark2$
  288.   5    Bookmark1$ encloses Bookmark2$
  289.   6    Bookmark2$ encloses Bookmark1$
  290.   7    Bookmark1$ and Bookmark2$ begin at the same point,  but Bookmark1$ is longer
  291.   8    Bookmark1$ and Bookmark2$ begin at the same point, but Bookmark2$ is longer
  292.   9    Bookmark1$ and Bookmark2$ end at the same place, but Bookmark1$ is longer
  293.  10    Bookmark1$ and Bookmark2$ end at the same place, but Bookmark2$ is longer
  294.  11    Bookmark1$ is below and adjacent to Bookmark2$
  295.  12    Bookmark1$ is above and adjacent to Bookmark2$
  296.  
  297. FUNCTION:  CmpBookmarks("Intro", "Begin")
  298. EFFECT:    If both refer to the same place, returns 0; if Intro is below begin, returns 1; if Intro is above Begin, returns 2.
  299.  
  300. FUNCTION:  CmpBookmarks("Intro", "Conclusion")
  301. EFFECT:    Returns 2 if Intro is entirely above Conclusion
  302.  
  303. FUNCTION:  CmpBookmarks("Price", "\Sel")
  304. EFFECT:    Returns 0 if the selection is the same as the bookmark Price
  305.  
  306. :ColumnSelect
  307.  
  308. Syntax:  ColumnSelect
  309.  
  310. Starts the column selection mode. Cancel ends this mode.
  311.  
  312. :ComboBox
  313.  
  314. Syntax:    ComboBox x, y, dx, dy, ArrayVariable$(), .Result$    (corrected, per HACKER'S GUIDE)
  315.  
  316. Creates an expanded combo box with the list box filled from the ArrayVariable$. 
  317. When the dialog box is used, .Result$ contains the current setting, your selected 
  318. choice, returned from Dialog.  (HACKER'S GUIDE ALERT:>Result$ isn't a field, it's just the Result; () on ArrayVariable$ are req'd; multi-dimensioned array as ArrayVariable$() will only show the first dimension (see HG))
  319.  
  320. ComboBox 6, 31, 49, 33, Air$(), .LB  
  321.  
  322. :ContinueMacro
  323.  
  324. (HACKER'S GUIDE ALERT: > undocumented)
  325.  
  326. :ControlRun 
  327.  
  328. Syntax:  ControlRun Application
  329.  
  330. Equivalent to the Run command on the System menu. Runs an application from the Word Control menu.
  331.  
  332. Statement          Effect
  333. ----------------           -----------
  334. ControlRun 0     Runs Clipboard
  335. ControlRun 1     Runs Control Panel
  336.  
  337. :CopyBookmark
  338.  
  339. Syntax:  CopyBookmark Bookmark1$, Bookmark2$
  340.  
  341. Sets Bookmark2$ equal to Bookmark1$.
  342.  
  343. STATEMENT: CopyBookmark "sales_receipts", "month_sales"
  344. EFFECT:    Changes references to the text covered by the bookmark month_sales to the bookmark sales_receipts
  345.  
  346. :CopyFormat
  347.  
  348. Syntax:  CopyFormat
  349.  
  350. Copies the formatting of the selected text. 
  351.  
  352. To use this statement:
  353.  
  354. 1  Make a selection.
  355. 2  Run CopyFormat.
  356. 3  Select where you want to paste the formatting.
  357. 4  Run OK (press Enter).
  358.  
  359. :CopyText
  360.  
  361. Syntax:  CopyText
  362.  
  363. Copies text. Equivalent to the copy to key (Shift+F2).
  364.  
  365. To use this statement:
  366.  
  367. 1  Make a selection.
  368. 2  Run CopyText.
  369. 3  Select where you want to paste the text.
  370. 4  Run OK (press Enter).
  371.  
  372. :CountBookmarks()
  373.  
  374. Syntax:  Num = CountBookmarks()
  375.  
  376. Returns the number of bookmarks you have defined in the document.
  377.  
  378. :CountFiles()
  379.  
  380. Syntax:  Num = CountFiles()
  381.  
  382. Returns the number of names in the file list on the File menu.
  383.  
  384. :CountFonts()
  385.  
  386. Syntax:  Num = CountFonts() 
  387.  
  388. Returns the number of fonts available with the printer you've selected.
  389.  
  390. :CountGlossaries()
  391.  
  392. Syntax:  Num = CountGlossaries([Context]) 
  393.  
  394. Returns the number of glossaries defined in the given context. Context can be 0 (zero) for global or 1 for document template. The default is global.
  395.  
  396. :CountMacros()
  397.  
  398. Syntax:  Num = CountMacros([Context], [All]) 
  399.  
  400. Returns the number of programs defined in the given context. Context can be 0 (zero) for global or 1 for document template. The default is global.
  401.  
  402. If All is nonzero, built in macros are included.
  403.  
  404. :CountMenuItems
  405.  
  406. (HACKER'S GUIDE ALERT: > undocumented)
  407.  
  408. :CountStyles()
  409.  
  410. Syntax:  Num = CountStyles([Context], [All]) 
  411.  
  412. Returns the number of styles defined in the given context. Context can be 0 (zero) for the document or 1 for document template. The default is document.
  413.  
  414. If All is nonzero, built in styles are included.
  415.  
  416. :CountWindows()
  417.  
  418. Syntax:  Num = CountWindows()
  419.  
  420. Returns the number of windows in the list on the Window menu.
  421.  
  422. :Date$()
  423.  
  424. Syntax:  A$ = Date$() 
  425.  
  426. Returns today's date. 
  427.  
  428. :DDEExecute
  429.  
  430. Syntax:  DDEExecute ChanNum, ExecuteString$
  431.  
  432. Sends an execute message over the channel ChanNum with an ExecuteString$, which is defined by the receiving application. Use the format described under SendKeys to send specific key sequences. 
  433.  
  434. The channel number must have been opened by the DDEInitiate() function. 
  435.  
  436. If the channel is not valid or if the receiving application refuses to execute the 
  437. instructions, an error is generated. 
  438.  
  439. :DDEInitiate()
  440.  
  441. Syntax:  ChanNum = DDEInitiate(App$, Topic$) 
  442.  
  443. Opens a DDE channel to an application. App$ is the application name defined by the other application. Topic$ describes something in the application you are accessing, usually the document containing the data you wish to use. 
  444.  
  445. If DDEInitiate() is successful, it returns the number of the open channel. All subsequent DDE macro functions use this number to specify the channel. This function returns 0 (zero) if it fails to open a channel. 
  446.  
  447. FUNCTION:  ChanNum = DDEInitiate("Excel", "LOAN.XLS")EFFECT:    Initiates a channel to Microsoft Excel and the file LOAN.XLS; the ChanNum variable holds the channel number returned
  448.  
  449. :DDEPoke
  450.  
  451. Syntax:  DDEPoke ChanNum, Item$, Data$
  452.  
  453. Sends the data to the item specified by Item$ in the application connected to channel ChanNum. ChanNum must have been opened by the DDEInitiate() function. If DDEPoke is unsuccessful, an error is generated.
  454.  
  455. :DDERequest$()
  456.  
  457. Syntax:  A$ = DDERequest$(ChanNum, Item$)
  458.  
  459. Requests the information specified by Item$ over the DDE channel specified by ChanNum. ChanNum must have been opened by the DDEInitiate() function. If DDERequest$() is unsuccessful, a null string ("") is returned.
  460.  
  461. DDERequest$() returns the data in CF_TEXT format. Pictures or text in Rich Text 
  462. Format cannot be transferred.
  463.  
  464. :DDETerminate
  465.  
  466. Syntax:  DDETerminate ChanNum 
  467.  
  468. Closes the channel ChanNum. The channel must have been opened with the DDEInitiate() function.
  469.  
  470. :DDETerminateAll
  471.  
  472. Syntax:  DDETerminateAll
  473.  
  474. Similar to DDETerminate, but closes all open channels.
  475.  
  476. :Declare
  477.  
  478. Syntax:  Declare Sub SubName Lib LibName [ParameterList] [Alias ModuleName] 
  479.  
  480. Syntax:  Declare Function FunctionName Lib LibName [ParameterList] [Alias ModuleName]  
  481.  
  482. Declares an external library function as a subroutine or function inside a macro.  For more information on the Declare statement, see Macros: Introduction.  
  483.  
  484. :DeleteBackWord
  485.  
  486. Syntax:  DeleteBackWord
  487.  
  488. Deletes the word immediately preceding the selection but does not place it on the Clipboard. 
  489.  
  490. :DeleteFile
  491.  
  492. (HACKER'S GUIDE ALERT: > See Kill)
  493.  
  494. :DeleteWord
  495.  
  496. Syntax:  DeleteWord
  497.  
  498. Deletes the word immediately following the selection but does not place it on the Clipboard. 
  499.  
  500. :Dialog
  501.  
  502. Syntax:  Dialog DialogRecord 
  503.  
  504. Displays the dialog box specified by DialogRecord, for editing. After editing, you can store edits in DialogRecord by choosing OK or lose edits by choosing Cancel.  Choosing Cancel produces a run-time error that you can trap with On Error. 
  505.  
  506. :Dialog Control Definition Statements
  507.  
  508. You can create your own dialog boxes and customized menus with Word macros. The  control statements used in dialog box construction are described in this section. For more information on dialog box construction, see Macros: Introduction.
  509. In the syntax lines, the following arguments are used:
  510.  
  511.   Arg    Meaning
  512.   -----    --------------
  513.     x     Horizontal position of the item in 1/4 system font character width units
  514.     y     Vertical position of the item in 1/8 system font character width units
  515.    dx    Width of the item in 1/4 system font character width units
  516.    dy    Height of the item in 1/8 system font character width units
  517.  
  518. (HACKER'S GUIDE ALERT:>Dialog Boxes are ltd to 512 characters, including variable data; max 32 items, list boxes =2, combo boxes =3...x also seems to be limited to <=510).
  519.  
  520. :Dim
  521.  
  522. Syntax:  Dim [Shared] Var [(Size)] [, Var [(Size)]...]
  523.  
  524. Declares a variable's type and allocates storage space for the variable. For more information on the Dim statement, see Macros: Introduction. 
  525.  
  526. :DisableInput
  527.  
  528. Syntax:  DisableInput [Disable]  
  529.  
  530. Prevents the Esc key from interrupting a macro. Input is enabled by setting Disable to 0 (zero).
  531.  
  532.   Statement           Effect
  533.   -----------------          -----------
  534.   DisableInput 0    Disable inactive
  535.   DisableInput 1    Disable active (default)
  536.  
  537. :DocClose
  538. Syntax:  DocClose [Save]
  539.  
  540. Closes the current window or pane. If Save is 1, Word saves the document if it has been edited (considered "dirty") since the last save; if Save is 2, Word does not save the document, but closes the window or pane.
  541.  
  542. :DocMaximize
  543. Syntax:  DocMaximize 
  544.  
  545. Zooms the document window to application window size. If it is already maximized, the screen is displayed in the restored state. 
  546.  
  547. :DocMaximize()
  548.  
  549. Syntax:  Log = DocMaximize()
  550.  
  551. Returns -1 if the window is maximized.
  552.  
  553. STATEMENT:  If Not DocMaximize() Then DocMaximize
  554. EFFECT:     Tests the document window to see if it is maximized; if it is, no action is 
  555. performed; if the window is not maximized, maximizes the window
  556.  
  557. :DocMove  
  558.  
  559. Syntax:  DocMove XPos, YPos
  560. Moves the document window to XPos, YPos relative to the top-left corner of the document area. Values are in points.
  561.  
  562. STATEMENT:  DocMove 20,40
  563. EFFECT:     Moves the window to the position 20 points to the right and 40 points down from the top-left corner of the document area.  [HACKER'S GUIDE ALERT: > since there's no echo off in WordBASIC, use Super DocSize 10,10 to make a window a small as possible, then doc Maximize to restore;  use DocMove 300,300 to move the window out of sight while macro running, then use DocMove 0,0 to bring it back.]
  564.  
  565. :DocRestore
  566.  
  567. Syntax:  DocRestore
  568.  
  569. Restores the Word window from a maximized state.
  570.  
  571. :DocSize
  572.  
  573. Syntax:  DocSize Width, Height
  574.  
  575. Sizes the document window to Width, Height. Values are in points.
  576.  
  577. :DocSplit
  578. Syntax:  DocSplit Percentage 
  579.  
  580. Splits the current window at the given percentage height.
  581.  
  582. :DocSplit()
  583.  
  584. Syntax:  Num = DocSplit() 
  585.  
  586. Returns the current window split position as a percentage of the window height, or 0 (zero) if the window isn't split.
  587.  
  588. :DoFieldClick
  589.  
  590. Syntax:  DoFieldClick
  591.  
  592. Simulates a mouse button double-click within the GOTOBUTTON and MACROBUTTON fields' prompt. See Fields for information on these fields.
  593.  
  594. :DoubleUnderline
  595.  
  596. Syntax:  DoubleUnderline [On]
  597.  
  598. Without the argument, toggles double underlining for the entire selection. If On is 1, Word makes the entire selection double underlined. If On is 0 (zero), Word removes double underlining from the entire selection.
  599.  
  600. :DoubleUnderline()
  601. Syntax:  Num = DoubleUnderline()
  602.  
  603. Returns 0 (zero) if none of the selection is double underlined, 1 if all of the selection is double underlined, or -1 if part of the selection is double underlined or more than one kind of underlining is used. 
  604.  
  605. :EditClear
  606.  
  607. Syntax:  EditClear [Count]
  608.  
  609. Deletes the selection without changing the contents of the Clipboard. If the selection is an insertion point, deletes the character to the right of the insertion point. If Count is supplied, deletes the specified number of characters from the right of the insertion point. If Count is a negative number, deletes to the left of the insertion point.
  610.  
  611. :EditCopy
  612.  
  613. Syntax:  EditCopy
  614.  
  615. Equivalent to the Copy command on the Edit menu. Copies the selection to the Clipboard.
  616.  
  617. :EditCut 
  618.  
  619. Syntax:  EditCut
  620.  
  621. Equivalent to the Cut command on the Edit menu. The selection is placed on the Clipboard and then deleted. 
  622.  
  623. :EditGlossary
  624.  
  625. Syntax:  EditGlossary Name$, [Context] 
  626.  
  627. (HACKER'S GUIDE ALERT: > Use Guy Gallo's ExpandGlossary and Edit Glossary which strip formatting before inserting things in the glossary to avoid problems; see additional notes in HG).
  628.  
  629. Equivalent to the Glossary command on the Edit menu. Used to define, delete, and insert glossary entries. Context can be 0 (zero) for global or 1 for document template. The default is global.
  630.  
  631. The default action is Insert. You can perform other actions by appending the command button name from the dialog box (Define or Delete) to the statement.
  632.  
  633. STATEMENT:  EditGlossary "CPR" , .Context = 1
  634. EFFECT:      Inserts the template-specific glossary entry named "CPR"
  635.  
  636. STATEMENT:   EditGlossary "CPR" , .Context = 0
  637. EFFECT:      Inserts the global glossary entry named "CPR"
  638.  
  639. STATEMENT:   EditGlossary "CPR" , .Define
  640. EFFECT:      Defines the glossary entry named "CPR"
  641.  
  642. STATEMENT:   EditGlossary "CPR" , .Delete
  643. EFFECT:      Deletes the glossary entry named "CPR"
  644.  
  645. :EditGoTo
  646.  
  647. Syntax:  EditGoTo Destination$
  648.  
  649. Equivalent to the Go To command on the Edit menu. Destination$ is a bookmark name or goto string. See the special bookmarks in the preceding section and Moving the Insertion Point in the User's Reference for more information on bookmarks.
  650.  
  651. STATEMENT:  EditGoTo "Disclaim"
  652. EFFECT:     Moves the insertion point to the bookmark "Disclaim"
  653.  
  654. STATEMENT:  EditGoTo "\StartOfDoc"
  655. EFFECT:     Uses a special bookmark to move the insertion point to the beginning of the document.  (HACKER'S GUIDE ALERT: > can also go to specific page with page no or "p" plus a number.  To go to a page numbered 3 that is not physical page 3,  Indicate page and section no.; i.e. "S2P3").
  656.  
  657. :EditHeaderFooter
  658.  
  659. Syntax:  EditHeaderFooter [Type], [StartingNum[$]], [NumFormat], 
  660. [HeaderDistance[$]], [FooterDistance[$]], [FirstPage], [OddAndEvenPages]
  661.  
  662. Equivalent to the Header/Footer command on the Edit menu. Opens the header or footer pane for editing.  (HACKER'S GUIDE ALERT:> only opens header or footerpane if ViewPage turned OFF.  If ViewPage is ON,  it will kick you up or down to header or footer on current page.  Use in conjunction with ClosePane to edit headers and footers with ViewPage OFF).
  663.  
  664. The following table summarizes the arguments. The arguments correspond to a check box. If the argument is 1, the check box is on. If the argument is 0 (zero), the check box is off. 
  665.  
  666. Argument    Description
  667. Type    Specifies header or footer 
  668. StartingNum[$]    Value at which to start page numbers
  669. NumFormat    Format for page numbers, as described in the following table.
  670. HeaderDistance[$]    Distance from top of page in points
  671. FooterDistance[$]    Distance from the bottom of the page in points
  672. FirstPage    Corresponds to Different First Page Pages check box
  673.  
  674. NumFormat    Numbers printed as
  675. ------------------     -------------------------------
  676.        0              1 2 3...
  677.        1              a b c...
  678.        2              A B C...
  679.        3              i ii iii...
  680.        4              I II III...
  681.  
  682. :EditHeaderFooterLink
  683.  
  684. Syntax:  EditHeaderFooterLink
  685.  
  686. Links the header/footer with a previous section. This is not possible in the first section of a document.  [HACKER'S GUIDE ALERT: > The mysterious "Link" they are talking about here is basically just page numbering.  If you set up a section with separate page numbering, then change your mind and want to go back to "normal" page numbering, you run an EditHeaderFooterLink.  That copies in the text from the previous header or footer, deleting the "new page numbering" info.  If you want to delete everything in a header or footer and unlink it - your best bet is to leave something (like a space) in the header or footer.  Otherwise it won't unlink.  I've had trouble running this guy with View Page ON.]
  687.  
  688. :EditPaste
  689.  
  690. Syntax:  EditPaste
  691.  
  692. Equivalent to the Paste command on the Edit menu. Copies the contents of the Clipboard to the insertion point. 
  693.  
  694. :EditPasteLink
  695.  
  696. Syntax:  EditPasteLink [AutoUpdate]
  697.  
  698. Equivalent to the Paste Link command on the Edit menu. Pastes a DDE (Dynamic Data Exchange) field. If AutoUpdate is 1, EditPasteLink pastes a DDEAUTO field. 
  699.  
  700. For information on DDE, see Macros: Introduction and Fields.
  701.  
  702. :EditPic
  703.  
  704. [HACKER'S GUIDE ALERT: > 
  705. This is an undocumented WordBASIC command.  Function: who knows?]
  706.  
  707. :EditReplace 
  708.  
  709. Syntax:  EditReplace [Search$], [Replace$], [WholeWord], [MatchCase], [Confirm], [Format]
  710.  
  711. Equivalent to the Replace command on the Edit menu. Replaces the Search$ string with Replace$.  If Search$ and Replace$ are not supplied, the strings used in the previous search and/or replace are used.
  712.  
  713. The following table summarizes the arguments. Each argument corresponds to a check box. 
  714.  
  715.    Argument       Description
  716.    ---------------       ------------------
  717.    WholeWord   Corresponds to the Whole Word check box
  718.    MatchCase    Corresponds to the Match Upper/Lowercase check box.
  719.    Confirm          Corresponds to the Confirm Changes check box
  720.    Format           Replaces formatting in addition to, or instead of, text
  721.  
  722. To replace formatting in addition to, or instead of, text, use EditReplaceChar, EditReplacePara, EditSearchChar, or EditSearchPara first to set up the formatting, then run EditReplace or EditSearch with Format set to 1. 
  723.  
  724. [HACKER'S GUIDE ALERT: > This just starts at the current cursor location, and heads toward the end of the document, replacing as it goes.  If you use .Confirm=0 and you want to replace all the occurrences of a string, make very, very sure you start at StartOfDocument, or use SendKeys to force EditReplace to loop all the way through the document, i.e.,
  725.  
  726.     SendKeys("%Y")
  727.     EditReplace "Foo", "Bar", .Confirm=0
  728.  
  729. Be leery of doing a lot of replacing from inside your own home-grown macro.  The problem is the "Undo" buffer: WinWord only allocates  a small amount of memory to keep track of changes (so you can "Undo" all the changes with one click).  If you have a bunch of EditReplace "hits", the Undo buffer can fill very quickly, and your macro will simply crash and burn with a message advising the user to save changes and exit WinWord.  (As I recall, this message comes up without tripping the usual WinWord "On Error" conditions.)  Doesn't matter how much memory you have on the machine - WinWord isn't smart enough to use all of it.
  730.  
  731. The Search$ and Replace$ strings in EditReplace are limited to 255 characters.  If you need to replace something larger than 255 characters, try this:
  732.  
  733. EditSearch "Whatcherlookinfer"
  734. If EditSearchFound() Then
  735. EditClear
  736. Insert "Thestringlongerthan255characters"
  737. End If
  738.  
  739. It's particularly important to keep the 255-character limitation in mind if you are automatically selecting text elsewhere, and don't know offhand if it can exceed 255 bytes.]
  740.  
  741. :EditReplaceChar
  742.  
  743. Syntax:  EditReplaceChar [Font$], [Points[$]], [Color], [Bold], [Italic], [SmallCaps], [Hidden], [Underline], [WordUnderline], [DoubleUnderline], [Position[$]], [Spacing[$]]
  744.  
  745. Defines the character formatting EditReplace uses to format replacement text. 
  746.  
  747. For a description of the arguments, see "FormatCharacter," later in this section.
  748.  
  749. :EditReplacePara
  750.  
  751. Syntax:  EditReplacePara [Alignment], [LeftIndent[$]], [RightIndent[$]], [FirstIndent[$]], [Before[$]], [After[$]], [LineSpacing[$]], [Style$], [KeepTogether], [KeepWithNext], [Border], [Pattern], [PageBreak], [NoLineNum]
  752.  
  753. Defines the paragraph formatting EditReplace uses to format replacement text. The arguments specify options available in the Format Paragraph dialog box. See "FormatParagraph," later in this section.
  754.  
  755. :EditSearch
  756.  
  757. Syntax:  EditSearch [Search$], [WholeWord], [MatchCase], [Direction], [Format]
  758.  
  759. Equivalent to the Search command on the Edit menu. Searches for the specified Search$. 
  760.  
  761. The following table summarizes the arguments. The arguments correspond to a check box. If the argument is 1, the check box is on. If the argument is 0 (zero), the 
  762. check box is off. 
  763.  
  764.    Argument       Description
  765.    ---------------       -------------------
  766.    WholeWord   Corresponds to the Whole Word check box
  767.    MatchCase    Corresponds to the Match Upper/Lowercase check box
  768.    Direction        0 searches toward beginning of document, without prompt; 1 searches toward end of document, with prompt (default); 2 searches toward end of document, without prompt
  769.    Format           Replaces formatting in addition to, or instead of, text; 0 ignores formatting (default), 1 uses formatting
  770.  
  771. [HACKER'S GUIDE ALERT: > James Gleick reports that he has encountered situations where an EditSearch in a long document hangs the system - the hourglass goes on and won't go off.  What the Tech Ref is talking about when it says "with prompt" or "without prompt" is the "Reached End of Document, Continue at Beginning?" prompt.  I have encountered situations where the default .Direction is NOT the last .Direction used.  Better to specify it each time.]
  772.  
  773. :EditSearchChar
  774.  
  775. Syntax:  EditSearchChar [Font$], [Points[$]], [Color], [Bold], [Italic], [SmallCaps], [Hidden], [Underline], [WordUnderline], [DoubleUnderline], [Position[$]], [Spacing[$]] 
  776.  
  777. Defines the character formatting EditSearch and EditReplace use to find formatted text. See "FormatCharacter," later in this section.
  778.  
  779. :EditSearchFound()
  780.  
  781. Syntax:  Log = EditSearchFound()
  782.  
  783. Returns -1 if the last EditSearch was successful.  Returns 0 (zero) if the last EditSearch was not successful.
  784.  
  785. :EditSearchPara
  786.  
  787. Syntax:  EditSearchPara [Alignment], [LeftIndent[$]], [RightIndent[$]], [FirstIndent[$]], [Before[$]], [After[$]], [LineSpacing[$]], [Style$], [KeepTogether], [KeepWithNext], [Border], [Pattern], [PageBreak], [NoLineNum]
  788.  
  789. Defines the paragraph formatting EditSearch and EditReplace use to find formatted text. The arguments specify options available in the Format Paragraph dialog box. See "Format Paragraph," later in this section. 
  790.  
  791. :EditSelectAll
  792.  
  793. Syntax:  EditSelectAll
  794.  
  795. Selects the entire document.
  796.  
  797. :EditSummaryInfo
  798.  
  799. Syntax:  EditSummaryInfo [Title$], [Subject$], [Author$], [Keywords$], [Comments$], [Directory$], [Template$], [CreateDate$], [LastSavedDate$], [LastSavedBy$], [RevisionNumber], [EditTime$], [LastPrintedDate$], [NumPages], [NumWords], [NumChars], [FileName$]  
  800.  
  801. Equivalent to the Summary Info command on the Edit menu. Sets the summary information and allows access to the Statistics dialog box. All the options in the Statistics dialog box are read─only except for the total editing time, which can be set with WordBASIC.
  802.  
  803. You can append the Update command button name to update the summary information. 
  804.  
  805.    Argument               Description
  806.    ---------------               ------------------
  807.    Title$                    Title
  808.    Subject$               Subject
  809.    Author$                 Author
  810.    Keywords$           Key words used to identify the document
  811.    Comments$          Comments on the document
  812.    Directory$            The document's directory location; read only
  813.    Template$            Document template
  814.    CreateDate$         Creation date; read-only
  815.    LastSavedDate$  Date the document was last saved;read-only
  816.    LastSavedBy$     Name of the person last saving the document; read-only
  817.    RevisionNumber  Number of times the document has been saved; read-only
  818.    EditTime$             Total time the document has been open 
  819.    LastPrintedDate$ Date document was last printed; read-only
  820.    NumPages           Number of pages; read-only
  821.    NumWords           Number of words; read-only
  822.    NumChars            Number of characters; read-only
  823.    FileName$            Makes changes to summary information for specified file name
  824.  
  825. [HACKER'S GUIDE ALERT: > Several places it says ".Comments$".  It should be ".Comment$", without the "s".  The .NumChars argument counts characters in headers, footers, footnotes, and annotations.  The reason why this number is so different from the "FileSave" message in the Status Bar?  The FileSave character counter only counts characters in the main part of the document.  For some reason, NumPages is listed as numeric.  It isn't.  You need to use, e.g.,
  826.  
  827. NumberofPages=Val(dlg.NumPages)
  828.  
  829. NumWords and NumChars probably work the same way.]
  830.  
  831. :EditTable
  832.  
  833. Syntax:  EditTable [Modify], [ShiftCells] 
  834.  
  835. Equivalent to the Table command on the Edit menu. Modify is 0 (zero) for Row, 1 for Column, or 2 for Selection. ShiftCells is 0 for Horizontally or 1 for Vertically. You can delete, merge, or split cells by appending the Delete, MergeCells, or SplitCells command button name.
  836.  
  837. :EditUndo
  838.  
  839. Syntax:  EditUndo
  840.  
  841. Equivalent to the Undo command on the Edit menu. Undoes the last action, if possible.  You can undo certain Word actions, such as Cut and Paste.  Some actions can't be undone. 
  842.  
  843. :ElseIf
  844.  
  845. See "If"
  846.  
  847. :Else
  848.  
  849. See "If"
  850.  
  851. :EmptyBookmark()
  852.  
  853. Syntax:  Log = EmptyBookmark(Name$) 
  854.  
  855. Returns -1 if Name$ is empty (an insertion point), or 0 (zero) if Name$ is not empty.
  856.  
  857. :End Dialog
  858.  
  859. Syntax:  End Dialog 
  860.  
  861. Ends the definition of the dialog box. 
  862.  
  863. :EndOfColumn
  864.  
  865. Syntax:  EndOfColumn [Select] 
  866.  
  867. Moves the insertion point to the bottom cell in the table column. If Select is a nonzero value, the selection is extended. 
  868.  
  869. :EndOfDocument
  870.  
  871. Syntax:  EndOfDocument [Select] 
  872.  
  873. Moves the selection to the end of the document. If Select is a nonzero value, the selection is extended.
  874.  
  875. :EndOfLine
  876.  
  877. Syntax:  EndOfLine [Select] 
  878.  
  879. Moves the selection to the end of the line. If Select is a nonzero value, the selection is extended.
  880.  
  881. :EndOfRow
  882.  
  883. Syntax:  EndOfRow [Select]
  884.  
  885. Moves the selection to the end of the last cell in the table row. If Select is a nonzero value, the selection is extended.
  886.  
  887. :EndOfWindow
  888.  
  889. Syntax:  EndOfWindow [Select]
  890.  
  891. Moves the selection to the end of the window. If Select is a nonzero value, the selection is extended.
  892.  
  893. :End If
  894.  
  895. See "If"
  896.  
  897. :End Function
  898.  
  899. See "Function"
  900.  
  901. :End Select
  902.  
  903. See "Select"
  904.  
  905. :End Sub
  906.  
  907. See "Sub"
  908.  
  909. :Eof()
  910.  
  911. Syntax:  Log = Eof(StreamNumber) 
  912.  
  913. Returns -1 when the end of the file attached to the stream number has been reached.
  914.  
  915. :Err
  916.  
  917. Syntax:  Num = Err
  918. Syntax:  Err = 0
  919.  
  920. This is a special variable that contains the error code for the most recent error condition. A list of error codes appears at the end of this chapter.
  921.  
  922. The form Err=0 is used to reset error trapping after an error has occurred.
  923.  
  924. :Error
  925.  
  926. Syntax:  Error ErrorNumber
  927.  
  928. Generates an error condition specified by ErrorNumber.  ErrorNumber is an error code.  Error serves two functions.  It can be used to generate a specified error condition in order to test an error handling routine, or it can be used to display an error message and terminate the operation of the macro program.  More...
  929.  
  930. :ExistingBookmark()
  931.  
  932. Syntax:  ExistingBookmark(Bookmark$) 
  933.  
  934. Returns -1 if Bookmark$ exists, or 0 (zero) if not. 
  935.  
  936. :ExitWindows
  937.  
  938. Syntax:  ExitWindows 
  939.  
  940. Exits Windows immediately without saving and returns to DOS. Use this statement with care.   [HACKER'S GUIDE ALERT: >  An undocumented WinWord command.  And it works.  Oh boy, does it!]
  941.  
  942. :ExpandGlossary
  943.  
  944. Syntax:  ExpandGlossary
  945.  
  946. Expands the word closest to the insertion point into the corresponding glossary text. 
  947.  
  948. :ExtendSelection
  949.  
  950. Syntax:  ExtendSelection [Character] 
  951.  
  952. Turns on extend mode, if it is not already turned on. If extend mode is already turned on, selection is extended to next unit; for example, if a character is selected, ExtendSelection extends the selection to the whole word. If Character is specified, the selection is extended to that character.  [HACKER'S GUIDE ALERT: >  If this command looks a little strange, it's because it does about a dozen different things depending on the context.   Here's an example of ExtendSelection.  It searches for a caret, turns on ExtendSelection, searches for the next caret, and clears out everything between the carets:
  953.  
  954. EditSearch .Search="^", .Direction=2
  955. While EditSearchFound()
  956. ExtendSelection
  957. EditSearch .Search="^", .Direction=2
  958.     EditClear
  959.     EditSearch .Search="^", .Direction=2
  960. Wend]
  961.  
  962. :File1, File2, File3, File4
  963.  
  964. Syntax:  File1
  965. Syntax:  File2
  966. Syntax:  File3
  967. Syntax:  File4
  968.  
  969. Equivalent to selecting a listed file on the File menu. Opens the file. An error is generated if you attempt to open a nonexistent file slot. For example, you cannot use File4 if only three files are listed under the File menu.
  970.  
  971. :FileClose
  972.  
  973. Syntax:  FileClose [Save]
  974.  
  975. Equivalent to the Close command on the File menu. Closes the current file and associated windows. The Save argument determines whether a save is forced: 1 forces a save, 2 forces no save. 
  976.  
  977. :FileExit
  978.  
  979. Syntax:  FileExit [Save]
  980.  
  981. Equivalent to the Exit command on the File menu. Quits Word. If any open documents have been edited and Save is omitted or is 0 (zero), you are prompted to save each changed document. If Save is 1, all edited documents are automatically saved before exiting. If Save is 2, the documents are not saved.
  982.  
  983. :FileFind 
  984.  
  985. Syntax:  FileFind [SortBy], [SearchList$], [Title$], [Subject$], [Author$], [Keywords$], [SavedBy$], [Text$], [DateCreatedFrom$], [DateCreatedTo$], [DateSavedFrom$], [DateSavedTo$], [MatchCase], [SearchAgain] 
  986.  
  987. Equivalent to the Find command on the File menu. It can be used to change the search criteria in subsequent FileFind statements. If you record a macro with FileFind, any other actions you perform in the File Find dialog box at that time, such as opening or deleting a document, editing summary information, or printing, are also recorded. SortBy specifies what information the documents are sorted by; see following table 
  988.  
  989.    Argument                 Description
  990.    ---------------                 -------------------
  991.    SearchList$             List of existing directories
  992.    Title$                       Title
  993.    Subject$                  Subject
  994.    Author$                    Author
  995.    Keywords$              Key words used to identify the document
  996.    SavedBy$                Name of the person saving the document
  997.    Text$                        Text in the document
  998.    DateCreatedFrom$   Document creation date you want to search from
  999.    DateCreatedTo$       Document creation date you want to search to
  1000.    DateSavedFrom$     Document save date you want to search from
  1001.    DateSavedTo$         Document save date you want to search to
  1002.    MatchCase               Specifies whether to match the case of the search text exactly; 0 is no (default), 1 is yes
  1003.    SearchAgain             Specifies whether to begin the search again; 0 is no (default), 1 is yes
  1004.  
  1005.   If SortBy is  Word sorts files
  1006.   -----------------   ---------------------------
  1007.       0              Alphabetically by name
  1008.       1              Alphabetically by author
  1009.       2             Chronologically by creation date
  1010.       3             Chronologically by date last saved
  1011.       4              Alphabetically by the name of the person who last saved the document
  1012.       5              By size, with smallest document listed first
  1013.  
  1014.   [HACKER'S GUIDE ALERT: >  SearchList$ is limited to 255 characters.  This can cause real, live bugs in the operation of FileFind.  Avoid it if you can!  Here's why:    WinWord, if so instructed, will scan your entire disk for .DOC files.  As it finds .DOC files, it appends the directory info for those "found" files to a string that appears at the top of the FileFind Search dialog box.  When that string - of all stupid things - hits 255 characters, WinWord stops searching, and doesn't tell you!  Bad bug.  It's in DOS Word, too, if that's any consolation.]
  1015.  
  1016. :FileName$()
  1017.  
  1018. Syntax:  A$ = FileName$(n) 
  1019.  
  1020. Returns the nth file in the file list. If n is 0 (zero), the name of the current file is returned. If n is greater than the number of files in the file cache, an error is generated. If there is no current document, FileName$(0) returns an empty string.
  1021.  
  1022. :FileNew
  1023.  
  1024. Syntax:  FileNew [Template$], [NewTemplate]
  1025.  
  1026. Equivalent to the New command on the File menu. The following table summarizes the arguments. 
  1027.  
  1028.    Argument        Description
  1029.    ---------------        ------------------
  1030.    Template$       Name of the document template on which to base the document
  1031.    NewTemplate  If 1, file is a document template; if 0, file is a document (default)
  1032.  
  1033.   [HACKER'S GUIDE ALERT: >  Note that there is a bug in FileNew.  If you have a macro that runs the built-in function FileNew, and the user clicks "CANCEL" in the built-in FileNew, the "CANCEL" cannot be trapped by an On Error statement.  Every other built-in function will let you trap "CANCEL" with an On Error.]
  1034.  
  1035. :FileOpen
  1036.  
  1037. Syntax:  FileOpen Name$, [ReadOnly]
  1038.  
  1039. Equivalent to the Open command on the File menu. Opens the named document.  An error is generated if the document does not exist. If ReadOnly is 1, the document is opened as read-only. 
  1040.  
  1041.   [HACKER'S GUIDE ALERT: >  If you want to open all files as text - bypassing the "convert file from" dialog box - you need to use the SetConversionState macro or manually edit the WIN.INI file to set the conversion state to NO.
  1042.  
  1043. When opening text files or foreign formatted files, Word for Windows will normally prompt with a dialog asking for the file format to convert from. In order to bypass the prompt and have Word for Windows open all foreign formatted files as text files, the conversion state in the WIN.INI needs to be set to "No" or "Conversion=No".
  1044.  
  1045. A macro to change the conversion state in the WIN.INI file, is included in the Word for Windows EXAMPLES.DOC file. This macro is called SetConversionState, and can be installed by opening the EXAMPLES.DOC file and clicking on the Install button.
  1046.  
  1047. Once installed, choose SetConversionState from the Macro menu to enable or disable the conversion of foreign file formats. When the file format conversion is disabled, all foreign files will load as text files.
  1048.  
  1049. The conversion state can also be set manually by editing the Microsoft Word section of the WIN.INI file.
  1050.  
  1051. [Microsoft Word] 
  1052. Conversion=No
  1053.  
  1054. The above lines will disable the file format dialog when importing foreign formatted files, so that all files load as text.
  1055.  
  1056. [Microsoft Word] 
  1057. Conversion=Yes
  1058.  
  1059. This setting will enable the file format conversion prompt when opening foreign formatted files.]
  1060.  
  1061. :FilePrint
  1062.  
  1063. Syntax:  FilePrint [Type], [NumCopies], [Range], [From$], [To$], [Reverse], [Draft], [UpdateFields], [PaperFeed], [Summary], [Annotations], [ShowHidden], [ShowCodes], [FileName$] 
  1064.  
  1065. Equivalent to the Print command on the File menu. Prints a document. The following table summarizes the arguments. 
  1066.  
  1067.    Argument    Description
  1068.    ---------------      -------------------
  1069.    Type              Type of document to print; can be 0 for document, 1 for summary information, 2 for annotations, 3 for style sheet, 4 for glossary, or 5 for key assignments
  1070.    NumCopies    Number of copies
  1071.    Range            Page range; 0 prints all of the document, 1 prints the selection, 2 prints the specified range of pages
  1072.    From$            Beginning of the range; can be page and/or section; ignored if Range equals 1 (selection)
  1073.    To$                 End of the range; can be page and/or section; ignored if Range equals 1 (selection)
  1074.    Reverse         0 prints the document from the first page to the last; 1 prints the document in reverse order
  1075.    Draft               Prints in draft mode
  1076.    UpdateFields  Updates fields before printing; some fields are automatically updated at printing; this argument updates fields not normally updated
  1077.    PaperFeed     0 is auto, 1 selects Bin1, 2 selects Bin2, 3 selects Bin3, 4 selects 
  1078.    Mixed, 5        selects Manual Feed
  1079.    Summary       Instructs Word to include summary information
  1080.    Annotations   Instructs Word to include annotations
  1081.    ShowHidden  Instructs Word to include hidden text 
  1082.    ShowCodes   Instructs Word to show field codes
  1083.    FileName$     If supplied, the specified file is printed; used by FileFind
  1084.  
  1085.   [HACKER'S GUIDE ALERT: >  This is one of the quirkiest functions in WordBASIC.  Be ready for lots of surprises.  If you're going to print a long document, there are a couple of tricks.
  1086.     First, you should never run WinWord maximized when you're printing a long document.  Why?  The hourglass will stare at you.  Make WinWord just a little smaller than full-window, and you'll be able to click outside of WinWord, and at least play a round of Solitaire while you're waiting for the printer.  Second, you can automatically resize WinWord by changing your FilePrint macro to do this:
  1087.  
  1088.    AppMove 0,0
  1089.    AppSize 300,300
  1090.    Dim dlg as FilePrint
  1091.    GetCurValues dlg
  1092.    On Error Goto mEnd
  1093.    Dialog dlg
  1094.    SuperFilePrint dlg
  1095.    mEnd:
  1096.  
  1097. Third, PrintManager won't take more than 20 "jobs".  If you run FilePrint more than 20 times without any pages printing, the PrintManager will object - saying it can't take any more - but WinWord will keep on plugging out pages.  If WinWord is running in a full window, there's nothing you can do but keep clicking OK at the PrintManager's admonitions.  Printing a range of pages is quite an art, if you have multiple sections that restart the page number.  The only tricks I've found to work is to either go through the document and wipe out the "Start with new page number" part of all section breaks, or to somehow futz with the .From$ and .To$ settings.  Valid .From$ and .To$ settings include "p3s2" or "3s2", both indicating page 3 of section 2.
  1098.  
  1099. Oh - selecting an entire page, then printing it will print the headers and footers of the first page of that section, not the headers and footers of the selected page.
  1100.  
  1101. Bug alert:  If you have EPS file support, and you run FilePrint but cancel it, your ruler will change from inches (or whatever) to points!  That's a world-class weird bug.  To fix it, edit your FilePrint macro, add one line after "Bye:"
  1102.  
  1103.     If FilePrintPreview()=0 Then UtilCustomize .Units=SavedUnit
  1104.  
  1105. NB.: this only happens with EPS support installed.  
  1106.  
  1107. There is a problem printing with "mixed" bins on the IIID.  I think it also happens with the IIISi and IID, but haven't been able to confirm it.
  1108.  
  1109. The problem: "mixed" bin selection works right the first time (i.e., FilePrint .PaperFeed=7).  But it doesn't work right the second (or subsequent) time.
  1110.  
  1111. Solution: use this instead of FilePrint .PaperFeed=7
  1112.  
  1113.    SendKeys("%O%em{Enter}")
  1114.    FilePrint
  1115.  
  1116. (Notes: That's a capital letter "Oh", there is no % in front of the "m", and the curly brackets around the "Enter" are just typed at your keyboard - no insert field funnies.) 
  1117.  
  1118. This little SendKeys kludge manually selects the Option button, then picks "mixed".  If you manually select "mixed" this way every time, the printer will print mixed.
  1119.  
  1120. I warned you that FilePrint is quirky!]
  1121.  
  1122. :FilePrinterSetup
  1123.  
  1124. Syntax:  FilePrinterSetup [Printer$] 
  1125.  
  1126. Equivalent to the Printer Setup command on the File menu. Printer$ is the name of the new printer to be activated. Enter this argument exactly as it appears in the File Printer Setup dialog box.
  1127.  
  1128. The Setup command button name can be appended to display the dialog box 
  1129. showing the printer options. 
  1130.  
  1131. FUNCTION: FilePrinterSetup "Apple LaserWriter Plus on COM2:"
  1132. RESULT:   Changes the printer to the Apple LaserWriter Plus attached to the COM2: port
  1133.  
  1134.   [HACKER'S GUIDE ALERT: >  Be very, very cautious when writing SendKeys parameters for FilePrinterSetup.  It's a jungle.  You CANNOT assume that if your SendKeys works on all the major printers, it will necessarily work on all the lesser printers.  And SuperPrint screws everything up.
  1135.  
  1136. Caveat Hacker!:  The FilePrinterSetup discussion should be prefaced by a classic remark:  Abandon hope, all ye who enter here.....  When you embark on FilePrinterSetup stuff, you are indeed entering the first ring of Hell.]
  1137.  
  1138. :FilePrintMerge
  1139.  
  1140. Syntax:  FilePrintMerge [From], [To] 
  1141.  
  1142. Equivalent to the Print Merge command on the File menu. If From or To is nonzero, Word merges the specified records only.
  1143.  
  1144. :FilePrintPreview
  1145.  
  1146. Syntax:  FilePrintPreview [On]
  1147.  
  1148. Equivalent to the Print Preview command on the File menu. Without On, toggles print preview mode. If On is nonzero, turns on print preview mode; if On is 0 (zero), turns off print preview mode.
  1149.  
  1150.   [HACKER'S GUIDE ALERT: >  When FilePrintPreview is on, you cannot use a macro to work with bookmarks.  Why?  I dunno.  There has been a lot of discussion about automatically maximizing the WinWord screen before running FilePrintPreview.  The problem stems from the odd way Winword handles AppMaximize.  (And I'm sure it doesn't help that the normal way of leaving FilePrintPreview mode is to CANCEL!)  Very strange behavior.  Here's the latest I have, by way of a solution:
  1151.  
  1152.    If AppMaximize()=0 then AppMaximize
  1153.    FilePrintPreview 1
  1154.    Input "Press Enter to exit Print Preview", A$
  1155.    FilePrintPreview 0
  1156.    AppRestore
  1157.  
  1158. That's a real kludge, because you can't DO anything in FilePrintPreview, and it changes the way FilePrintPreview works (i.e., it requires you to push enter to get out, in spite of the beautiful CANCEL button up at the top).  Yecch.
  1159.  
  1160. Another alternative:
  1161.  
  1162.    If AppMaximize()=0 Then AppMaximize
  1163.    FilePrintPreview
  1164.    If FilePrintPreview()=0 Then AppRestore
  1165.  
  1166. Which isn't much better.  Oh - there's a typo in FilePrintPreview$().  The example should say:
  1167.  
  1168.   A=FilePrintPreview()    'cuz it returns an integer.]
  1169.  
  1170. :FilePrintPreviewBoundaries
  1171.  
  1172. Syntax:  FilePrintPreviewBoundaries [On]
  1173.  
  1174. Displays the text boundaries if On is nonzero; turns off display if On is 0 (zero).  If On is omitted, toggles the display of text boundaries.
  1175.  
  1176. :FilePrintPreviewPages
  1177.  
  1178. Syntax:  FilePrintPreviewPages [Pages]
  1179.  
  1180. Without the argument, toggles display between one and two pages. 
  1181.  
  1182.   Pages arg   Description
  1183.   ----------------   -------------------
  1184.        0          Toggles the display state (default)
  1185.        1          One page
  1186.        2          Two pages
  1187.  
  1188. :FileSave
  1189.  
  1190. Syntax:  FileSave
  1191.  
  1192. Equivalent to the Save command on the File menu. Saves the current document.
  1193.  
  1194. :FileSaveAll
  1195.  
  1196. Syntax:  FileSaveAll [Save]
  1197.  
  1198. Equivalent to the Save All command on the File menu. Prompts the user to save all changed files including NORMAL.DOT. If Save is 1, all edited documents are automatically saved. If Save is 2, the documents are not saved.
  1199.  
  1200. :FileSaveAs 
  1201.  
  1202. Syntax: FileSaveAs [Name$], [Format], [FastSave], [CreateBackup], [LockAnnot]
  1203.  
  1204. Equivalent to the Save As command on the File menu. Saves the current document with a new name and/or format. Name$ specifies the new name. Format specifies the new format. 
  1205.  
  1206. Argument    Meaning
  1207. FastSave    Saves changes made since last save 
  1208. CreateBackup    Creates a backup copy of the document
  1209. LockAnnot    Locks the document for annotations
  1210.  
  1211.  Format   Document type
  1212.  -----------   ------------------------
  1213.       0       Normal (Word format) 
  1214.       1       Document Template
  1215.       2       Text Only (extended characters saved in ANSI character set) 
  1216.       3       Text+Breaks (plain text with line breaks; extended characters saved in ANSI character set) 
  1217.       4       Text Only (extended characters saved in IBM PC character set)
  1218.       5       Text+Breaks (text with line breaks; extended characters saved in IBM PC character set)
  1219.       6       Rich Text Format (RTF)
  1220.  
  1221. Other file formats can be specified. They must be listed in your WIN.INI file under the Microsoft Word entry. 
  1222.  
  1223.   [HACKER'S GUIDE ALERT: >  WinWord normally saves all documents in "Fast Save" format.  Older versions of Grammatik, among other programs, have trouble dealing with Fast Save format files.  (Selecting Create Backup automatically disables the Fast Save option.) 
  1224.  
  1225.  If you change your FileSaveAs macro to:
  1226.  
  1227.    Dim dlg As FileSaveAs
  1228.    GetCurValues dlg
  1229.    dlg.FastSave=0                  <--------New Line
  1230.    On Error goto Done
  1231.    Dialog dlg
  1232.    Super FileSaveAs dlg
  1233.    Done:                           <--------New Line
  1234.  
  1235. You'll disable Fast Save.
  1236.  
  1237. If you want to have a macro save the active document under a new name but skip the Summary Info dialog box - even when Customize has "Prompt for Summary Info" - here's how to do it
  1238.  
  1239.     Dim dlg as EditSummaryInfo
  1240.     GetCurValues dlg
  1241.     temp=dlg.SummaryPrompt
  1242.     EditSummaryInfo .SummarPrompt=0
  1243.     FileSaveAs .Name="Foobar"
  1244.     EditSummaryInfo .SummaryPrompt=temp]
  1245.  
  1246. :Files$()
  1247.  
  1248. Syntax:  A$ = Files$(FileSpec$) 
  1249.  
  1250. Returns the first filename matching FileSpec$.  If FileSpec$ is not supplied, the next file matching the last-used FileSpec$ is returned. This function can be used to get a list of files matching a FileSpec$ by specifying the FileSpec$ on the first iteration, and then omitting it thereafter. If no files match, a null string ("") is returned.    [HACKER'S GUIDE ALERT: >  FileSpec$ is limited to a max of 255 characters.]
  1251.  
  1252.   Function                            Return value
  1253.   --------------                            ---------------------
  1254.      A$ = Files$("WIN.*")       WIN.DOC, WIN.COM, WIN.TXT or any file with the name WIN.
  1255.  
  1256. :Font
  1257. Syntax:  Font Name$, [Size]
  1258.  
  1259. Applies the named font to the selection. You can include the Size argument instead 
  1260. of following this statement with the FontSize statement.
  1261.  
  1262. :Font$( )
  1263.  
  1264. Syntax:  A$ = Font$( )
  1265.  
  1266. Returns the font name of the current selection. If the selection has more than one font, a null string is returned.
  1267.  
  1268. :FontSize()
  1269.  
  1270. Syntax:  Num = FontSize()
  1271.  
  1272. Returns the font size of the current selection. If the selection has more than one font size, 0 (zero) is returned.
  1273.  
  1274. :FontSize
  1275. Syntax:  FontSize Size
  1276.  
  1277. Sets the size of the current selection in points.
  1278.  
  1279. :For...Next
  1280.  
  1281. Syntax:    For CounterVariable = Start To End [Step Increment]
  1282.               Statements
  1283.         Next [CounterVariable]
  1284.  
  1285. Executes the statements between For and Next as many times as it takes the CounterVariable to go from the Start value to the End value.  Increment is the value used to increment the counter (default is 1).
  1286.  
  1287. The CounterVariable with Next is optional.  If CounterVariable is omitted, Next causes WordBASIC to loop back to the first incompleted For...Next statement.  More....
  1288.  
  1289. :FormatCharacter
  1290.  
  1291. Syntax:  FormatCharacter [Font$], [Points[$]], [Color], [Bold], [Italic], [SmallCaps], [Hidden], [Underline], [WordUnderline], [DoubleUnderline], [Position[$]], [Spacing[$]]
  1292.  
  1293. Equivalent to the Character command on the Format menu. Applies character formatting to the selection. The following table summarizes the arguments.  Some arguments take measurements in points. Other arguments correspond to a check box. 
  1294.  
  1295.    Argument            Description
  1296.    ---------------            -------------------
  1297.    Font$                  Name of font
  1298.    Points[$]             Size in points
  1299.    Color                   Color of the text; see CharColor in "Other Command Equivalents" for a list of colors
  1300.    Bold                    Corresponds to the Bold check box
  1301.    Italic                    Corresponds to the Italic check box
  1302.    SmallCaps          Corresponds to the Small Kaps check box
  1303.    Hidden                Corresponds to the Hidden check box
  1304.    Underline            Corresponds to the Underline check box
  1305.    WordUnderline   Corresponds to the Word Underline check box
  1306.    DoubleUnderline Corresponds to the Double Underline checkbox
  1307.    Position[$]           Refers to the character position on the line, as shown in the table that follows
  1308.    Spacing[$]           Specifies the amount of character spacing in  points, as shown in the table that follows
  1309.  
  1310.    Position[$] arg         Position
  1311.    ------------------------         -------------
  1312.    Zero                          Normal
  1313.    A positive number    Superscript the specified number of points
  1314.    A negative number   Subscript the specified number of points
  1315.  
  1316.    Spacing[$] arg          Spacing
  1317.    -----------------------          -------------
  1318.    Zero                          Normal
  1319.    A positive number    Expanded
  1320.    A negative number   Condensed
  1321.  
  1322.   [HACKER'S GUIDE ALERT: >  The weird [$] thing that follows the Points, Position, and Spacing arguments just mean that you can use either character or numeric values.  For example, these are identical:
  1323.  
  1324.     FormatCharacter .Points="14"
  1325.     FormatCharacter .Points=14
  1326.  
  1327. Note that the "$" is never attached to the argument name.
  1328.  
  1329. There's a weird bug in FormatCharacter.  Unless you change the arguments, it always comes up with a "0 point Superscript".  That just happens to be the same thing as "normal", but try explaining that one to a novice!  Easy solution:
  1330.  
  1331.     Dim dlg as FormatCharacter
  1332.     SendKeys("%N")
  1333.     Dialog dlg
  1334.  
  1335. Hey, it works......]
  1336.  
  1337. :FormatDefineStyles
  1338.  
  1339. Syntax:  FormatDefineStyles Name$, [BasedOn$], [NextStyle$], [AddToTemplate], [NewName$], [FileName$], [Source] 
  1340.  
  1341. Defines a new style with the specified Name$.  If a style with that name already exists, that style is made the current style. FormatDefineStyles sets up the style; to define the character, paragraph, and tab formats, use the FormatDefineStylesChar, FormatDefineStylesPara, and FormatDefineStylesTabs statements described later in this section. To redefine an existing style, include the specific arguments with the FormatDefineStyles statement. Examples are shown in the following table:
  1342.  
  1343. STATEMENT:  FormatDefineStyles "Title"
  1344. EFFECT:     Defines the new style "Title" 
  1345.  
  1346. STATEMENT:  FormatDefineStylesChar .Bold = 1
  1347. EFFECT:     Redefines the current style to include bold text 
  1348.  
  1349. STATEMENT:  FormatDefineStylesPara  .Alignment = 2
  1350. EFFECT:     Redefines the current style ("Title") to include centered text
  1351.  
  1352. STATEMENT:  FormatDefineStyles "Headline" .Delete
  1353. EFFECT:     Deletes the style "Headline"
  1354.  
  1355. The BasedOn$ argument specifies a style on which to base the new style. The NextStyle$ argument specifies the style to be applied after the new style.
  1356.  
  1357. AddToTemplate can be 0 for the document only, or 1 for the document and its template. 
  1358.  
  1359. The Delete, Rename, and Merge command button names can be appended. 
  1360.  
  1361. The NewName$ argument specifies a new name for the style; it is used only in conjunction with the Rename command button. 
  1362.  
  1363. The FileName$ argument is used only with the Merge command button. It specifies the template or document whose style sheet is to be merged with that of the current document or template.
  1364.  
  1365. Source is used only in conjunction with the Merge command button name, and can be 0 (zero) (from the current document or template to a specified document or template) or 1 (from a specified document or template to the current document or template). 
  1366.  
  1367. :FormatDefineStylesChar 
  1368.  
  1369. Defines the current style with the specified character properties. This statement takes the same arguments as its corresponding format function. See "FormatCharacter," earlier in this section.
  1370.  
  1371. :FormatDefineStylesPara 
  1372.  
  1373. Defines the current style with the specified paragraph properties. This statement takes the same arguments as its corresponding format function. See "FormatParagraph," later in this section.
  1374.  
  1375. :FormatDefineStylesPosition 
  1376.  
  1377. Defines the current style with the specified position properties. This statement takes the same arguments as its corresponding format function. See "FormatPosition," later in this section.
  1378.  
  1379. :FormatDefineStylesTabs 
  1380.  
  1381. Defines the current style with the specified tab properties. This statement takes the same arguments as its corresponding format function. See "FormatTabs," later in this section.
  1382.  
  1383. :FormatDocument
  1384.  
  1385. Syntax:  FormatDocument [PageWidth[$]], [PageHeight[$]], [DefTabs[$]], [TopMargin[$]], [BottomMargin[$]], [LeftMargin[$]], [RightMargin[$]], [Gutter[$]], [MirrorMargins], [FootnotesAt], [StartingNum[$]], [RestartNum], [Template$], [WidowControl] 
  1386.  
  1387. Equivalent to the Document command on the Format menu. Applies document formatting properties. 
  1388.  
  1389. The following table summarizes the arguments. Some arguments take measurements in points. Other arguments correspond to a check box. 
  1390.  
  1391.    Argument             Description
  1392.    ---------------             --------------------
  1393.    PageWidth[$]      Width of page
  1394.    PageHeight[$]     Height of page
  1395.    DefTabs[$]           Distance between default tab stops
  1396.    TopMargin[$]       Width of top margin 
  1397.    BottomMargin[$]  Width of bottom margin 
  1398.    LeftMargin[$]       Width of left margin 
  1399.    RightMargin[$]    Width of right margin 
  1400.    Gutter[$]              Binding width
  1401.    MirrorMargins     If 1, LeftMargin becomes InsideMargin and RightMargin becomesOutsideMargin
  1402.    FootnotesAt         Where to place footnotes; can be 0 for end of section, 1 for bottom of page, 2 for beneath text, or 3 for end of document
  1403.    StartingNum[$]    Starting footnote number
  1404.    RestartNum         Corresponds to the Restart # Each Section check box
  1405.    Template$            Document template
  1406.    WidowControl      Corresponds to the Widow Control check box
  1407.  
  1408. To set the global or template default, append the SetDefault command button name to this statement. This is a powerful argument that changes the default document properties to those specified in the statement.
  1409.  
  1410.   [HACKER'S GUIDE ALERT: >  The weird [$] thing that follows all of the arguments (!) just means that you can use either character or numeric values.  For example, these are identical (if your unit of measurement is inches):
  1411.  
  1412. FormatDocument .TopMargin=0.5
  1413. FormatDocument .TopMargin="0.5 in"
  1414. FormatDocument .TopMargin="0.5" + Chr$(34)
  1415.  
  1416. Note that the "$" is never attached to the argument name.]
  1417.  
  1418. :FormatParagraph
  1419.  
  1420. Syntax:  FormatParagraph [Alignment], [LeftIndent[$]], [RightIndent[$]], [FirstIndent[$]], [Before[$]], [After[$]], [LineSpacing[$]], [Style$], [KeepTogether], [KeepWithNext], [Border], [Pattern], [PageBreak], [NoLineNum] 
  1421.  
  1422. Applies paragraph formatting. 
  1423.  
  1424.   Alignment arg  Para formatting
  1425.   ----------------------  -------------------------
  1426.          0               Left 
  1427.          1               Centered
  1428.          2               Right
  1429.          3               Justified
  1430.  
  1431. The LeftIndent[$], RightIndent[$], and FirstIndent[$] arguments specify the amount of left, right, and first-line indents, respectively. The Before[$] and After[$] arguments specify the amount of spacing above and below a paragraph, respectively. The LineSpacing[$] argument specifies the amount of spacing for all lines in a paragraph. The Style$ argument specifies a style to be applied to a paragraph. The KeepTogether and KeepWithNext arguments prevent page breaks within a paragraph and between paragraphs, respectively.
  1432.  
  1433.   Border arg    Para formatting
  1434.   -----------------    -------------------------
  1435.           0           No border
  1436.           1           Box
  1437.           2           Bar to left of paragraph
  1438.           3           Bar above paragraph
  1439.           4           Bar below paragraph
  1440.  
  1441.   Pattern arg   Paragraph formatting
  1442.   -----------------    -----------------------------------
  1443.           0           Single (normal)
  1444.           1           Thick
  1445.           2           Double
  1446.           3           Shadow
  1447.  
  1448. The PageBreak argument inserts a page break before printing the paragraph. The NoLineNum argument turns off line numbering for the paragraph. 
  1449.  
  1450.   [HACKER'S GUIDE ALERT: >  Note that FormatParagraph affects the white space surrounding "Format Position" positioned pictures and paragraphs.
  1451.  
  1452. Note also that FormatParagraph can affect cell height in tables.
  1453.  
  1454. The weird [$] thing that follows most of the arguments just means that you can use either character or numeric values.  For example, these are identical (if your unit of measurement is inches):
  1455.  
  1456.    FormatParagraph .FirstIndent=0.5
  1457.    FormatParagraph .FirstIndent="0.5 in"
  1458.    FormatParagraph .FirstIndent="0.5" + Chr$(34)
  1459.  
  1460. Note that the "$" is never attached to the argument name.]
  1461.  
  1462. :FormatPicture 
  1463.  
  1464. Syntax:  FormatPicture [Border], [ScaleY], [ScaleX], [CropTop[$]], [CropLeft[$]], [CropBottom[$]], [CropRight[$]]
  1465.  
  1466. Equivalent to the Picture command on the Format menu. Applies picture formatting properties.
  1467.  
  1468. The following table summarizes the arguments. Some arguments take measurements in points. Other arguments correspond to check boxes. 
  1469.  
  1470.    Argument        Description
  1471.    ---------------        -------------------
  1472.    Border             Same available values as Border for FormatParagraph
  1473.    ScaleY,
  1474.          ScaleX       Amount to scale the picture; the measurement is a percentage
  1475.    CropTop[$]
  1476.    CropLeft[$],
  1477.    CropBottom[$],
  1478.    CropRight[$]     Amount to crop the picture, in points; if a negative value is used, the picture is not cropped, but the amount of white space around the picture is increased
  1479.  
  1480.   [HACKER'S GUIDE ALERT: >  The weird [$] thing that follows the Crop arguments just means that you can use either character or numeric values.  For example, these are identical (if your unit of measurement is inches):
  1481.  
  1482.    FormatPicture .CropTop=0.5
  1483.    FormatPicture .CropTop="0.5 in"
  1484.    FormatPicture .CropTop="0.5" + Chr$(34)
  1485.  
  1486. Note that the "$" is never attached to the argument name.]
  1487.  
  1488. :FormatPosition 
  1489.  
  1490. Syntax:  FormatPosition [Horizontal[$]], [HRelativeTo], [Vertical[$]], [VRelativeTo], [DistanceFromText], [ParagraphWidth[$]]
  1491.  
  1492. Applies position formatting to the selected paragraphs. 
  1493.  
  1494.    Argument                 Description
  1495.    ---------------                 -------------------
  1496.    Horizontal[$]            Absolute distance in points; can be Left, Center, Right, Inside, or Outside
  1497.    HRelativeTo             Distance in points, relative to specified item (margin, page, or column); can be 0 for Margin, 1 for Page, or 2 for Column
  1498.    Vertical[$]                 Absolute distance in points; can be  Normal, Top, Center, or Bottom 
  1499.    VRelativeTo              Distance in points relative to specified item (margin or page); can be 0 for Margin, or 1 for Page 
  1500.    DistanceFromText    Amount of white space between a picture and text surrounding the picture
  1501.    ParagraphWidth[$]   Total line width of the paragraph; if 0, use width as calculated by Word
  1502.  
  1503. The Reset command button name can be appended to cancel the position formatting of the paragraphs.
  1504.  
  1505.   [HACKER'S GUIDE ALERT: >  See the Hacker's Guide "Most Commonly Asked WinWord Questions" for a step-by-step approach to positioning a picture.  The same procedure works for other paragraphs, too.
  1506.  
  1507. When a paragraph contains only a picture, Format Position works as one would expect: the paragraph is "cropped" (for lack of a better term) to the size of the picture, to facilitate moving it around in Page Preview.
  1508.  
  1509. But when a paragraph contains text (or a dingbat), it is considered to extend to the full, pre-defined width of the paragraph (which defaults to six inches). That's why people working with Drop Caps have to do a Format Paragraph to trim the para (in this case of Drop Caps, the entire paragraph is just one letter) down to size, before moving it around in Page Preview.
  1510.  
  1511. The paragraph width in Format Position needs to be set to the width of the drop cap or character (e.g., 0.5 inches), in order to get text beside the letter. Hopefully drop caps will be a little more straight forward in the future. For now, set the paragraph width in Format Position.
  1512.  
  1513. The weird [$] thing that follows the Horizontal, Vertical and ParagraphWidth arguments just means that you can use either character or numeric values.  For example, these are identical (if your unit of measurement is inches):
  1514.  
  1515.     FormatPosition .Horizontal=0.5
  1516.     FormatPosition .Horizontal="0.5 in"
  1517.     FormatPosition .Horizontal="0.5" + Chr$(34)
  1518.  
  1519. Note that the "$" is never attached to the argument name.]
  1520.  
  1521. :FormatSection 
  1522.  
  1523. Syntax:  FormatSection [Columns], [ColumnSpacing[$]], [ColLine], [SectionStart], [Footnotes], [LineNum], [StartingNum[$]], [FromText[$]], [CountBy], [NumMode], [VertAlign]
  1524.  
  1525. Equivalent to the Section command on the Format menu. Applies section formatting properties to the selection. Some arguments take measurements in points or numbers. Other arguments correspond to check boxes. 
  1526.  
  1527.    Argument                  Description
  1528.    ---------------                  -------------------
  1529.    Columns                   Number of columns
  1530.    ColumnSpacing[$]    Distance between columns
  1531.    ColLine                     Corresponds to the Line Between check box
  1532.    SectionStart              Determines where the section properties take effect; can be 0 (no break), 1 (column), 2 (page), 3 (even page), or 4 (odd page)
  1533.    Footnotes                 Corresponds to the Include Footnotes check box.
  1534.    LineNum                   Corresponds to the Line Numbering check  box.
  1535.    StartingNum[$]         Number at which to begin line numbering
  1536.    FromText[$]              Distance from text; can be 0 (Auto) or a positive number
  1537.    CountBy                    Increment at which to print line numbers 
  1538.    NumMode                 Determines how pages are numbered; can be 0 (per page), 1 (per section), or 2 (continuous) 
  1539.    VertAlign                    Alignment of section to the page; can be 0 (top), 1 (center), or 2 (justify)
  1540.  
  1541.   [HACKER'S GUIDE ALERT: >  When choosing Format Section and selecting Line Numbers, the line numbers will be clipped if you have a left margin < 0.62 inches.  Minimum left margin for two-digit line numbers is 0.62 inches.  Minimum for three-digit numbers is 0.72 inches.  Minimum for four-digit line numbers is 0.82 inches.
  1542.  
  1543. The weird [$] thing that follows several of the arguments just means that you can use either character or numeric values.  For example, these are identical (if your unit of measurement is inches):
  1544.  
  1545.  
  1546. Note that the "$" is never attached to the argument name.]
  1547.  
  1548. :FormatStyles
  1549.  
  1550. Syntax:  FormatStyles Name$, [Create]
  1551.  
  1552. Equivalent to the Styles command on the Format menu. Applies the style in Name$ to the selected paragraphs. If the style does not exist and Create is not specified or is 0 (zero), an error is generated. If Create is specified as 1, the style is created with the properties of the selection, if it doesn't already exist. 
  1553.  
  1554. :FormatTable 
  1555.  
  1556. Syntax:  FormatTable [FromColumn], [Column] [ColumnWidth], [SpaceBetweenCols[$]], [IndentRows[$]], [MinimumRowHeight], [OutlineBorder], [TopBorder], [BottomBorder], [InsideBorder], [LeftBorder], [RightBorder], 
  1557. [AlignRows], [ApplyTo]
  1558.  
  1559. Equivalent to the Table command on the Format menu. When recording, pressing the Next or Prev Columns command button records a new FormatTable command.
  1560.  
  1561.    Argument                      Description
  1562.    ---------------                       -------------------
  1563.    FromColumn,
  1564.           Column                  Range of columns
  1565.    ColumnWidth                Width of columns in points
  1566.    SpaceBetweenCols[$]   Space between columns in points
  1567.    IndentRows[$]               Indent in points
  1568.    MinimumRowHeight      Minimum row height in points
  1569.    OutlineBorder,
  1570.          TopBorder,
  1571.          BottomBorder,
  1572.          InsideBorder,
  1573.          LeftBorder,
  1574.          RightBorder            Borders can be 0 (none), 1 (single), 2 (thick), or 3 (double)
  1575.    AlignRows                     Alignment can be 0 (left), 1 (right), or 2 (center)
  1576.    ApplyTo                         0 applies the formatting to the  selection; 1 applies the formatting to the entire table
  1577.  
  1578.   [HACKER'S GUIDE ALERT: >  The weird [$] thing that follows several of the arguments just means that you can use either character or numeric values.  For example, these are identical (if your unit of measurement is inches):
  1579.  
  1580.     FormatTable .SpaceBetweenCols=0.5
  1581.     FormatTable .SpaceBetweenCols="0.5 in"
  1582.     FormatTable .SpaceBetweenCols="0.5" + Chr$(34)
  1583.  
  1584. Note that the "$" is never attached to the argument name.]
  1585.  
  1586. :FormatTabs
  1587.  
  1588. Syntax:  FormatTabs [Position], [Align], [Leader] 
  1589.  
  1590. Equivalent to the Tabs command on the Format menu. Position is a measurement 
  1591. in points. 
  1592.  
  1593.    Align arg       Alignment
  1594.    --------------       ----------------
  1595.         0               Left
  1596.         1               Centered 
  1597.         2               Right
  1598.         3               Decimal
  1599.  
  1600.    Leader arg    Leader character
  1601.    -----------------     ----------------------------
  1602.         0               None
  1603.         1               Dot 
  1604.         2               Dash
  1605.         3               Underline
  1606.  
  1607. Set is the default action. You can also clear specified tabs or clear all tabs by appending the Clear or ClearAll command button name to the statement.  Recording a set of tab actions generates new commands, as shown in the following example:
  1608.  
  1609. STATEMENT:  FormatTabs .ClearAll
  1610. EFFECT:     Clears all tabs 
  1611.  
  1612. STATEMENT:  FormatTabs "1.5 in", .Set
  1613. EFFECT:     Positions right-aligned tab at 1.5-inch interval
  1614.  
  1615. STATEMENT:  FormatTabs "3 in", .Clear
  1616. EFFECT:     Clears the tab at 3 inches 
  1617.  
  1618. STATEMENT:  FormatTabs "4.5 in"
  1619. EFFECT:     Positions a tab at 4.5 inches
  1620.  
  1621. :Function...End Function
  1622.  
  1623. Syntax:    Function Name [ParameterList]
  1624.                    Statement(s)
  1625.                 End Function
  1626.  
  1627. Defines a function. The ParameterList is a list of variables, separated by commas, for receiving arguments to the function. For more information on user-defined functions, see Macros: Introduction. 
  1628.  
  1629. :GetBookmark$()
  1630.  
  1631. Syntax:  A$ = GetBookmark$(BookmarkName$) 
  1632.  
  1633. Returns the text at the specified bookmark.  
  1634.  
  1635. :GetCurValues
  1636.  
  1637. Syntax:  GetCurValues DialogRecord 
  1638.  
  1639. Stores in DialogRecord the current values for a previously dimensioned dialog box.  For more information, see Macros: Introduction.  
  1640.  
  1641. :GetGlossary$()
  1642.  
  1643. Syntax:  A$ = GetGlossary$(Name$, [Context]) 
  1644.  
  1645. Returns the text of the glossary entry in Name$. The Context is 0 (zero) for global (default) or 1 for document template. 
  1646.  
  1647. FUNCTION:    New$ = GetGlossary$("Disclaim", 1)
  1648.         Print New$
  1649. EFFECT:    Sets New$ to the text in the document template glossary specified by 
  1650. the name "Disclaim" and prints the text.
  1651.  
  1652. :GetProfileString$()
  1653.  
  1654. Syntax:  A$ = GetProfileString$([App$], Key$) 
  1655.  
  1656. Gets a value from the current WIN.INI file. App$ is the name of the Microsoft Windows application. If the application is not specified, the string [Microsoft Word] is used. If the Key$ is not found, the function returns a null string.
  1657.  
  1658. :GlossaryName$()   
  1659.  
  1660. Syntax:  A$ = GlossaryName$(Count, [Context], [All]) 
  1661.  
  1662. Returns the name of the glossary defined in the given context (global or document template). Count must be in the range from 1 to CountGlossaries(Context).  The name is taken from the list in the given context. Context is 0 (zero) for global, 1 for document template.
  1663.  
  1664. :GoBack
  1665.  
  1666. Syntax:  GoBack
  1667.  
  1668. Toggles among the last three selections where text or formatting has changed.
  1669.  
  1670. :Goto
  1671.  
  1672. Syntax:  Goto Label/LineNumber
  1673.  
  1674. Branches unconditionally to a label or line number.  (HACKER'S GUIDE ALERT:>.at most one space before label, one space after, then colon, no tabs).
  1675.  
  1676. :GroupBox
  1677.  
  1678. Syntax:  GroupBox x, y, dx, dy, Text$ 
  1679.               GroupBox 60, 29, 32, 37, "Status"
  1680.  
  1681. Creates a box with a title. A GroupBox does not have a result.  (HACKER'S GUIDE ALERT:>Text$ variable is req'd).
  1682.  
  1683. :GrowFont
  1684.  
  1685. Syntax:  GrowFont 
  1686.  
  1687. Increases the size of the selected font. Can be used either on the selection, or at the insertion point.
  1688.  
  1689. :HangingIndent
  1690.  
  1691. Syntax:  HangingIndent
  1692.  
  1693. Sets the indent of the selection to the next tab stop in the first paragraph.  Sets the first line of the paragraph flush with the left margin.
  1694.  
  1695. :Help
  1696. Syntax:  Help
  1697.  
  1698. Activates Help. Equivalent to pressing F1.
  1699.  
  1700. :HelpAbout
  1701.  
  1702. Syntax:  HelpAbout
  1703.  
  1704. Displays a dialog box with the Word version number and copyright information.
  1705.  
  1706. :HelpActiveWindow
  1707.  
  1708. Syntax:  HelpActiveWindow 
  1709.  
  1710. Activates Help for the active window.
  1711.  
  1712. :HelpContext
  1713.  
  1714. Syntax:  HelpContext
  1715.  
  1716. Activates context-sensitive Help. Equivalent to pressing Shift+F1.
  1717.  
  1718. :HelpIndex
  1719.  
  1720. Syntax:  HelpIndex
  1721.  
  1722. Displays the list of Help topics.
  1723.  
  1724. :HelpKeyboard
  1725.  
  1726. Syntax:  HelpKeyboard
  1727.  
  1728. Displays list of keyboard Help topics.
  1729.  
  1730. :HelpTutorial
  1731.  
  1732. Syntax:  HelpTutorial
  1733.  
  1734. Starts the Tutorial.
  1735.  
  1736. :HelpUsingHelp
  1737.  
  1738. Syntax:  HelpUsingHelp
  1739.  
  1740. Displays Help topics on how to use Help.
  1741.  
  1742. :Hidden
  1743.  
  1744. Syntax:  Hidden [On]
  1745.  
  1746. Without an argument, toggles hidden text for the entire selection. If On is nonzero, makes the entire selection hidden text if the first character is hidden. If On is 0 (zero), removes hidden text from the entire selection.
  1747.  
  1748. :Hidden()
  1749.  
  1750. Syntax:  Num = Hidden()
  1751.  
  1752. Returns 0 (zero) if none of the selection is hidden text, 1 if all of the selection is idden text, or -1 if part of the selection is hidden text.
  1753.  
  1754. :HLine
  1755.  
  1756. Syntax:  HLine [Count]
  1757.  
  1758. Scrolls horizontally to the right by Count lines. If Count is not specified, one line is 
  1759. the default. "Lines" mean the amount the screen is scrolled by clicking the mouse in a horizontal scroll bar arrow. A negative Count scrolls to the left.
  1760.  
  1761. :HPage
  1762.  
  1763. Syntax:  HPage [Count]
  1764.  
  1765. Scrolls horizontally by Count screens. If Count is not specified, one screen is the default. A negative Count scrolls to the left.
  1766.  
  1767. :HScroll
  1768.  
  1769. Syntax:  HScroll Percentage
  1770.  
  1771. Scrolls horizontally the specified percentage of the document width.
  1772.  
  1773. :HScroll()
  1774.  
  1775. Syntax:  Num = HScroll()
  1776.  
  1777. Returns the current horizontal scroll position as a percentage of the document width.
  1778.  
  1779. :IconBarMode
  1780.  
  1781. Syntax:  IconBarMode
  1782.  
  1783. Activates icon bar mode. 
  1784.  
  1785. :If/ElseIf/Else/End If
  1786.  
  1787. Syntax:  If Condition Then Statement(s)
  1788.  
  1789. Syntax:  If Condition1 Then
  1790.                      Statement(s)
  1791.                  [ElseIf Condition2 Then
  1792.                      Statement(s)
  1793.                  [Else Statement(s)]
  1794.               End If
  1795.  
  1796. Performs conditional execution or branching, depending on the expressions. The conditions in an If...ElseIf...Else...End If block can be any numeric expressions in WordBASIC For more information, see Macros: Introduction.
  1797.  
  1798. :Indent
  1799.  
  1800. Syntax:  Indent
  1801.  
  1802. Indents the selection. The indent is aligned with the next tab stop. Indent does not change a first-line indent. 
  1803.  
  1804. :Input
  1805.  
  1806. Syntax:  Input [#]StreamNumber, variable, [variable]  
  1807.  
  1808. Reads a line from the file specified by #StreamNumber into the variables listed.  The line read from the file is separated into individual values by commas. If a StreamNumber is not specified, you are prompted in the status bar.
  1809.  
  1810. :Input$()
  1811.  
  1812. Syntax:  A$ = Input$(n, StreamNumber)
  1813.  
  1814. Reads n characters from the file specified by StreamNumber.
  1815.  
  1816. :InputBox$()
  1817.  
  1818. Syntax:   A$ = InputBox$(Prompt$, [Title$], [Default$]) 
  1819.  
  1820. Displays an editable dialog box. Returns the text that was in the box when OK was chosen. If you specified a default, it is loaded into the dialog box when it is displayed.
  1821.  
  1822.   [HACKER'S GUIDE ALERT: >  Prompt$, Title$ and Default$ are all limited to a total of 255 characters.
  1823.  
  1824. I don't know if the variable itself (equivalently, the input text) is also limited to 255 characters; try it if there's any chance somebody will type in that much.
  1825.  
  1826. The Gadflies had fun with this one a while back.
  1827.  
  1828.    x$ = GetProfileString$("Test")
  1829.    If x$ = "" Then 
  1830.       x$="&Ampersand"
  1831.       SetProfileString("Microsoft Word", "Test", x$)
  1832.   End If
  1833.   x$=InputBox$("Edit ampersand", "Test", x$)
  1834.   SetProfileString("Microsoft Word", "Test", x$)
  1835.  
  1836. Want to watch WinWord go hyperexponential?  Ah, the chaos.....]
  1837.  
  1838. :Insert
  1839.  
  1840. Syntax:  Insert Text$
  1841.  
  1842. Inserts the given text at the insertion point. Nonprinting characters are inserted as Chr$(n) statements. 
  1843.  
  1844.      Value       Character inserted
  1845.    --------------    ------------------------------
  1846.    Chr$(11)       Linefeed
  1847.    Chr$(30)       Nonbreaking hyphen
  1848.    Chr$(31)       Optional hyphen
  1849.    Chr$(160)     Nonbreaking space
  1850.  
  1851. :InsertBookmark
  1852.  
  1853. Syntax:  InsertBookmark Name$ 
  1854.  
  1855. Equivalent to the Bookmark command on the Insert menu. Creates or deletes the named bookmark. If the Delete command button is appended, the bookmark is deleted.  If Delete is not specified, the bookmark is created at the current selection.  If you specify a nonexistent bookmark for deletion, an error is generated.    [HACKER'S GUIDE ALERT: >  Bookmarks are not allowed in headers or footers.
  1856.  
  1857. The name of a bookmark must be contain letters, numbers, or the _underline character; max 20 characters, and the first character must be alpha.  (I.e., don't start a bookmark name with a number!)]
  1858.  
  1859. :InsertBreak 
  1860.  
  1861. Syntax:  InsertBreak Type
  1862.  
  1863. Equivalent to the Break command on the Insert menu. Inserts a page, section, or column break at the current selection.
  1864.  
  1865.    Type arg     Break type
  1866.    --------------     ------------------
  1867.          0              Page
  1868.          1              Column
  1869.  
  1870. The following are section breaks:
  1871.  
  1872.    Type arg    Break type
  1873.    --------------    ------------------
  1874.          2             Next
  1875.          3             Continuous
  1876.          4             Even
  1877.          5             Odd
  1878.  
  1879.   [HACKER'S GUIDE ALERT: >  his one's a little tough to explain......
  1880.  
  1881. Say you're in a section.  And that section has a specific starting page number.  Let's call the starting page number "n".  So far so good?
  1882.  
  1883. Now.  Say you insert a section break inside that section.  The page numbering is a little strange.  The new section will start at page "n", no matter where in the section the break is inserted.
  1884.  
  1885. Confusing?  Try debugging it!]
  1886.  
  1887. :InsertColumnBreak
  1888.  
  1889. Syntax:  InsertColumnBreak 
  1890.  
  1891. Inserts a column break at the insertion point. If the insertion point is in a table, the break is inserted above the row in which the insertion point is located. 
  1892.  
  1893. :InsertDateField
  1894.  
  1895. Syntax:  InsertDateField
  1896.  
  1897. Inserts a DATE field at the selection.
  1898.  
  1899. :InsertField
  1900.  
  1901. Syntax:  InsertField Field$
  1902.  
  1903. Equivalent to the Field command on the Insert menu. Inserts the specified field at the selection. Do not include the field characters in Field$. For more information on inserting fields, see Fields.
  1904.  
  1905. :InsertFieldChars
  1906.  
  1907. Syntax:  InsertFieldChars
  1908.  
  1909. Inserts field characters ({ }) at the selection.
  1910.  
  1911. :InsertFile
  1912.  
  1913. Syntax:  InsertFile Name$, [Range$], [Link]
  1914.  
  1915. Equivalent to the File command on the Insert menu. Inserts the named file at the current selection. 
  1916.  
  1917. Range$ refers to a bookmark if Name$ refers to a Word document. If Name$ refers to another document type (for example, a Microsoft Excel worksheet), then Range$ refers to a named range. Only that part of the file is inserted. If Link is 1, a link to the file is inserted instead of the actual file. 
  1918.  
  1919. :InsertFootnote
  1920.  
  1921. Syntax:  InsertFootnote [Reference$] 
  1922.  
  1923. Equivalent to the Footnote command on the Insert menu. Inserts a footnote at the current selection. 
  1924.  
  1925. Reference$ is footnote reference text that you supply.
  1926.  
  1927. To insert a footnote separator, continued footnote separator or notice for continued footnotes, append the Separator, ContSeparator, or ContNotice command button name. 
  1928.  
  1929. :InsertIndex
  1930.  
  1931. Syntax:  InsertIndex [Type], [HeadingSeparator], [Replace]
  1932.  
  1933. Equivalent to the Index command on the Insert menu. Inserts an INDEX field at the current selection.   Type is 0 (zero) for a normal index (default) or 1 for a run-in index.  HeadingSeparator is 0 for none (default), 1 for a blank line, or 2 for a letter.   If Replace is 1, the existing index is overwritten. If Replace is omitted or 0, the existing index is not overwritten. 
  1934.  
  1935.   [HACKER'S GUIDE ALERT: >  Take a look at the {index} field, in the Hacker's Guide page 359.  There's all sorts of fun stuff that can go bump in the night - most notably what happens when you have so many page numbers that they won't all fit on one line.]
  1936.  
  1937. :InsertIndexEntry
  1938.  
  1939. Syntax:  InsertIndexEntry [Entry$], [Range$], [Bold], [Italic]
  1940.  
  1941. Equivalent to the Index Entry command on the Insert menu. Inserts an XE field at the current selection. If Entry$ is omitted, the selection is the entry. The following table summarizes the arguments. The arguments correspond to check boxes. 
  1942.  
  1943.    Argument           Description
  1944.    ---------------     -----------------------------
  1945.      Bold         Corresponds to the Bold check box
  1946.      Italic         Corresponds to the Italic check box
  1947.  
  1948. :InsertPageBreak
  1949.  
  1950. Syntax:  InsertPageBreak
  1951.  
  1952. Inserts a page break at the current selection.
  1953.  
  1954. :InsertPageField
  1955.  
  1956. Syntax:  InsertPageField
  1957.  
  1958. Inserts a PAGE field at the current selection.
  1959.  
  1960. :InsertPageNumbers
  1961.  
  1962. Syntax:  InsertPageNumbers Type, Position
  1963.  
  1964. Inserts a current PAGE field into the header or footer.
  1965.  
  1966. Type is 0 (zero) for header, 1 for footer. Position is 0 (left aligned), 1 (centered), or 2 (right aligned).
  1967.  
  1968. :InsertPara
  1969.  
  1970. Syntax:  InsertPara
  1971.  
  1972. Inserts a paragraph mark at the current selection.
  1973.  
  1974. :InsertPicture
  1975.  
  1976. Syntax:  InsertPicture [Name$]
  1977.  
  1978. Equivalent to the Picture command on the Insert menu. Inserts an IMPORT field at the current selection. If Name$ is not supplied, a 1-inch graphic frame with a single border is inserted. 
  1979.  
  1980. :InsertTable
  1981.  
  1982. Syntax:  InsertTable [NumColumns], [NumRows], [InitialColWidth[$]], [ConvertFrom] 
  1983.  
  1984. Equivalent to the Table command on the Insert menu. Choosing Format is recorded with a FormatTable statement following InsertTable.
  1985.  
  1986.    Argument                 Description
  1987.    ----------------                -------------------
  1988.    NumColumns          Number of columns in table
  1989.    NumRows               Number of rows in table
  1990.    InitialColWidth[$]    Width of column in points
  1991.    ConvertFrom           Can be 0 (paragraphs), 1 (tab-delimited text), or 2 (comma-delimited text)
  1992.  
  1993. :InsertTableOfContents 
  1994.  
  1995. Syntax:  InsertTableOfContents [Source], [From], [To], [Replace]
  1996.  
  1997. Equivalent to the Table Of Contents command on the Insert menu. Inserts a TOC Source is 0 (zero) for outline headings, or 1 for table entry fields. From and To refer to the outline levels used.
  1998.  
  1999. If Replace is 1, the existing table of contents is overwritten. If Replace is omitted or 0 (zero), the existing table of contents is not overwritten. 
  2000.  
  2001. :InsertTableToText 
  2002. Syntax:  InsertTableToText [ConvertTo]
  2003.  
  2004. Converts the selected cells to normal text. 
  2005.  
  2006. ConvertTo may be 0 (zero) for paragraphs, 1 for tab-delimited text, or 2 for comma delimited text.
  2007.  
  2008. :InsertTimeField
  2009.  
  2010. Syntax:  InsertTimeField
  2011.  
  2012. Inserts a TIME field at the current selection.
  2013.  
  2014. :Instr()
  2015.  
  2016. Syntax:  Num = Instr([n,] A$, B$)   Note: corrected per Hacker's Guide..see below.
  2017.  
  2018. Searches for B$ in A$. Returns the number of the character where B$ started, or 0 (zero) if B$ is not found in A$. If n is supplied, the search starts at character n.
  2019.  
  2020.   [HACKER'S GUIDE ALERT: >  An important typo.  It should read
  2021.  
  2022.    Num=InStr([Index,] Source$, Search$)
  2023.  
  2024. Note that if you omit the [Index], you must omit the comma as well!]
  2025.  
  2026. :Int()
  2027.  
  2028. Syntax:  Num = Int(n) 
  2029.  
  2030. Returns the integer part of n.
  2031.  
  2032. Function    Return value 
  2033. -------------    --------------------
  2034. Int(98.6)          98
  2035. Int(-9.6)           -9
  2036.  
  2037. :IsDirty()
  2038.  
  2039. Syntax:  Log = IsDirty()
  2040.  
  2041. Returns -1 if the document has been changed (made dirty) since the last save, 0 (zero) if the document has not been changed.    [HACKER'S GUIDE ALERT: >  ]Okay.  I'm gonna step you through how to shoot yourself in the foot.  If you misuse it, don't go blamin' me!
  2042.  
  2043. You can change Glossary entries - or anything else stored in NORMAL.DOT, for that matter - and still have your macro leave NORMAL.DOT "not dirty".  (Why would you want to do that?  To save your users from spending hours watching "Saving NORMAL.DOT 0% Complete".)  Watch out.  If you start muckin' around with IsDirty, you can clobber intentional mods to NORMAL.DOT.
  2044.  
  2045. After you're through doing whatever you want to do to NORMAL.DOT - add and delete a Glossary entry, for example - just run these two lines from a TEMPLATE macro:
  2046.  
  2047.     FileOpen "normal.dot"
  2048.     FileClose 2
  2049.  
  2050. You may have to add subdirectory info to "normal.dot".
  2051.  
  2052. :Italic
  2053.  
  2054. Syntax:  Italic [On]
  2055.  
  2056. Without the argument, toggles italic for the entire selection. If On is nonzero, makes the entire selection italic. If On is 0 (zero), removes italic from the entire selection.
  2057.  
  2058. :Italic()   
  2059.  
  2060. Syntax:  Num = Italic()
  2061.  
  2062. Returns 0 (zero) if none of the selection is italic, 1 if all of the selection is italic, or -1 if part of the selection is italic.
  2063.  
  2064. :JustifyPara
  2065.  
  2066. Syntax:  JustifyPara
  2067.  
  2068. Justifies the selected paragraphs.
  2069.  
  2070. :JustifyPara()
  2071.  
  2072. Syntax:  Num = JustifyPara()
  2073.  
  2074. Returns 0 (zero) if none of the selected paragraphs are justified, 1 if all of the selected paragraphs are justified, or -1 if more than one kind of paragraph alignment is used. 
  2075.  
  2076. :KeyCode
  2077.  
  2078.   [HACKER'S GUIDE ALERT: >  This is another undocumented WinWord command.  Function unknown.]
  2079.  
  2080. :Key Macro$
  2081.  
  2082.   [HACKER'S GUIDE ALERT: >  Undocumented. Function unknown.]
  2083.  
  2084. :Kill
  2085.  
  2086. Syntax:  Kill Name$
  2087.  
  2088. Deletes the file specified by Name$.
  2089.  
  2090. :LCase$()
  2091.  
  2092. Syntax:  A$ = LCase$(A$)
  2093.  
  2094. Returns A$ converted to lowercase.
  2095.  
  2096. :Left$()
  2097.  
  2098. Syntax:  A$ = Left$(A$, n) 
  2099.  
  2100. Returns the leftmost n characters of A$.
  2101.  
  2102.    Function                  Return value 
  2103.    --------------                  ----------------------
  2104.    A$ = "Legal File List"
  2105.    Print Left$(A$,5)              Legal 
  2106.  
  2107.    A$ = "Legal File List"
  2108.    Print Left$(A$,10)            Legal File 
  2109.  
  2110. :LeftPara
  2111.  
  2112. Syntax:  LeftPara
  2113.  
  2114. Left aligns the selected paragraphs.
  2115.  
  2116. :LeftPara()
  2117.  
  2118. Syntax:  Num = LeftPara()
  2119.  
  2120. Returns 0 (zero) if none of the selected paragraphs are left aligned, 1 if all of the selected paragraphs are left aligned, or -1 if more than one kind of paragraph alignment is used. 
  2121.  
  2122. :Len()
  2123.  
  2124. Syntax:  Num = Len(A$) 
  2125.  
  2126. Returns the number of characters in A$.
  2127.  
  2128. Function        Return value 
  2129. --------------        --------------------
  2130. A$="Trey Research"
  2131. Print Len(A$)                       13 
  2132.  
  2133. :Let
  2134.  
  2135. Syntax:  [Let] Var = Expression
  2136.  
  2137. Assigns the value of an expression to a variable. Let is optional.
  2138.  
  2139. :LineDown
  2140.  
  2141. Syntax:  LineDown [Repeat], [Select]
  2142.  
  2143. Moves the selection down by Repeat lines. If the Repeat argument is omitted, 1 is assumed. If Select is nonzero, the selection is extended down by Repeat lines.
  2144.  
  2145. :LineDown()
  2146.  
  2147. Syntax:  Log = LineDown([Repeat], [Select]) 
  2148.  
  2149. Moves the selection down by Repeat lines. Returns 0 (zero) if the action cannot be completed.
  2150.  
  2151.   [HACKER'S GUIDE ALERT: >  LineDown() is broke and needs fixin'.  Bad.  Don't use it unless you have absolutely no other choice.  LineDown(n), where n > 1, will return a FALSE if NO LineDown is possible.  But it will return a TRUE if ANY LineDown is possible.  Say what?  Okay.  Imagine your cursor is on line 2 of a three-line document.  Your macro says:
  2152.  
  2153.     If LineDown(5) MsgBox
  2154.  
  2155. "HeeHee.  Gotcha!"  Even though WinWord can't go down five lines - there's only one line left in the document - you'll still get a TRUE test, i.e., "HeeHee. Gotcha!"..Also watch out for an infinite loop testing LineDown() when the last line of a document is selected.  I'm trying to figure this one out, myself, right now.]
  2156.  
  2157. :Line Input
  2158.  
  2159. Syntax:  Line Input [#]StreamNumber, Variable$
  2160.  
  2161. Reads an entire line from the file specified by StreamNumber and puts the result in the specified string variable. If a StreamNumber is not specified, you are prompted in the status bar.  Similar to the Input statement but LineInput doesn't break the line into separate values at commas. 
  2162.  
  2163. :LineUp
  2164. Syntax:  LineUp [Repeat], [Select]
  2165.  
  2166. Moves the selection up by Repeat lines. If the Repeat argument is omitted, 1 is assumed. If Select is nonzero, the selection is extended up by Repeat lines.  If Select is 0 (zero) or omitted, the selection is not extended. 
  2167.  
  2168.    Statement      Effect
  2169.    ----------------      ---------
  2170.     LineUp 20     Moves the selection point up 20 lines from the insertion point, but does not extend the selection
  2171.  
  2172. :LineUp()
  2173.  
  2174. Syntax:  Log = LineUp([Repeat], [Select]) 
  2175.  
  2176. Moves the selection up by Repeat lines. Returns 0 (zero) if the action cannot be completed. For example, the function would return 0 if the insertion point is at the beginning of the document.
  2177.  
  2178. :ListBox
  2179.  
  2180. Syntax:  ListBox x, y, dx, dy, ArrayVariable$(), .Result$     Note: this is corrected per HG, see below.
  2181.  
  2182. Creates a list box control filled with the strings in ArrayVariable$. When the dialog box is used, .Result$ contains the current setting, your selected choice, returned from Dialog.    [HACKER'S GUIDE ALERT: >  That should read ListBox x, y, dx, dy, ArrayVariable$(), .Index
  2183.  
  2184. It isn't a .Field -- it's just a plain, old .Index into ArrayVariable$.  Ignore the mumbo-jumbo.
  2185.  
  2186. The () parenthesis on ArrayVariable$() are required.  Dumb.
  2187.  
  2188. A multi-dimensional array used as the ArrayVarriable$ argument will only display the first dimension.  For example,
  2189.  
  2190.     Dim MyArray$(10,100,100)
  2191.     ListBox 8,20,400,12, MyArray$(), .Field
  2192.  
  2193. will only show the first-dimensioned ten items of MyArray$, i.e., MyArray$(0 thru 10, 0, 0) -  I think.]
  2194.  
  2195. :LockFields
  2196.  
  2197. Syntax:  LockFields
  2198.  
  2199. Prevents the fields within the selection from being updated.
  2200.  
  2201. :Lof()
  2202.  
  2203. Syntax:  Num = Lof(StreamNumber) 
  2204.  
  2205. Returns the length of the file, in bytes. 
  2206.  
  2207. :MacroAssignToKey 
  2208. Syntax:  MacroAssignToKey [Name$], [KeyCode], [Context] 
  2209.  
  2210. Equivalent to the Assign to Key command on the Macro menu. You can assign a macro to any key or key combination.
  2211.  
  2212. Assigns the macro Name$ to the specified KeyCode.  KeyCode is a number representing the exact key. The number is not equivalent to the SendKeys syntax. 
  2213.  
  2214. Context is 0 (zero) for global or 1 for document template.
  2215.  
  2216. Assign is the default action. The ResetAll command button name can be appended to return the key assignments to the default state. The UnAssign command button name removes a macro connection to a specific key.
  2217.  
  2218.    Add this    for this key
  2219.    -------------    ------------------
  2220.      1024          Alt +
  2221.       512           Shift +
  2222.       256           Ctrl +
  2223.  
  2224.   [HACKER'S GUIDE ALERT: >  To well and truly unassign an assigned key, you have to issue the command twice!
  2225.  
  2226.     MacroAssignToKey Key, MacroName$, .Context=0, .Unassign
  2227.     MacroAssignToKey Key, MacroName$, .Context=0, .Unassign
  2228.  
  2229. For some reason, Microsoft didn't document any but a small portion of the key codes.  Here's the list I've compiled, after some exhaustive tests.  Any code that is not on this list is not implemented - at least on my system (with a Northgate Omnikey Plus keyboard).  And note that some keyboards map things a little differently.
  2230.  
  2231. For the key assignments where Guy and I didn't get the same results, extreme caution is urged.  I dunno what's going on......
  2232.  
  2233. Note that these codes only apply to the MacroAssignToKey command.  If you try to use about half these suckers from the Macro AssignToKey drop-down menu, you're out of luck.
  2234.  
  2235.    3    Scroll Lock
  2236.    8    Backspace
  2237.    9    Tab
  2238.    12    NumPad 5, with NumLock OFF
  2239.    13    Enter
  2240.    27    Esc
  2241.    32    Space
  2242.    33    PgUp Key
  2243.    34    PgDn Key
  2244.    35    End
  2245.    36    Home
  2246.    37    Left Arrow Key
  2247.    38    Up Arrow Key
  2248.    39    Right Arrow Key
  2249.    40    Down Arrow Key
  2250.    45    Insert Key
  2251.    46    Delete Key
  2252.    47    Help (?) (!)
  2253.    48    0 (above the letters, not on the NumPad)
  2254.    49    1 (above the letters, not on the NumPad)
  2255.    50    2 (above the letters, not on the NumPad)
  2256.    51    3 (above the letters, not on the NumPad)
  2257.    52    4 (above the letters, not on the NumPad)
  2258.    53    5 (above the letters, not on the NumPad)
  2259.    54    6 (above the letters, not on the NumPad)
  2260.    55    7 (above the letters, not on the NumPad)
  2261.    56    8 (above the letters, not on the NumPad)
  2262.    57    9 (above the letters, not on the NumPad)
  2263.    58    : (colon)
  2264.    59    ; (semicolon)
  2265.    60    < (less than)
  2266.    61    = (equals)
  2267.    62    > (greater than)
  2268.    63    ? (question mark)
  2269.    64    @ (at sign)
  2270.    65    a (lower case "a"; for upper case, use 512+65, i.e., Shift+"a")
  2271.    66    b (lower case "b"; for upper case use 512 + 66, i.e., Shift+"b")
  2272.    67    c (lower case "c; for upper case use 512 + 67, i.e., Shift+"c")
  2273.    68    d (lower case "d"; for upper case use 512 + 68, i.e., Shift+"d")
  2274.    69    e (lower case "e"; for upper case use 512 + 69, i.e., Shift+"e")
  2275.    70    f (lower case "f"; for upper case use 512 + 70 , i.e., Shift+"f")
  2276.    71    g (lower case "g"; for upper case use 512 + 71, i.e., Shift+"g")
  2277.    72    h (lower case "h"; for upper case use 512 + 72, i.e., Shift+"h")
  2278.    73    i (lower case "i"; for upper case use 512 + 73, i.e., Shift+"i")
  2279.    74    j (lower case "j"; for upper case use 512 + 74, i.e., Shift+"j")
  2280.    75    k (lower case "k"; for upper case use 512 + 75, i.e., Shift+"k")
  2281.    76    l (lower case "l"; for upper case use 512 + 76, i.e., Shift+"l")
  2282.    77    m (lower case "m"; for upper case use 512+77,i.e., Shift+"m")
  2283.    78    n (lower case "n"; for upper case use 512 + 78, i.e., Shift+"n")
  2284.    79    o (lower case "o"; for upper case use 512 + 79, i.e., Shift+"o")
  2285.    80    p (lower case "p"; for upper case use 512 + 80, i.e., Shift+"p")
  2286.    81    q (lower case "q"; for upper case use 512 + 81, i.e., Shift+"q")
  2287.    82    r (lower case "r"; for upper case use 512 + 82, i.e., Shift+"r")
  2288.    83    s (lower case "s"; for upper case use 512 + 83, i.e., Shift+"s")
  2289.    84    t (lower case "t"; for upper case use 512 + 84, i.e., Shift+"t")
  2290.    85    u (lower case "u"; for upper case use 512 + 85, i.e., Shift+"u")
  2291.    86    v (lower case "v"; for upper case use 512 + 86, i.e., Shift+"v")
  2292.    87    w (lower case "w"; for upper case use 512+87,i.e., Shift+"w")
  2293.    88    x (lower case "x"; for upper case use 512 + 88, i.e., Shift+"x")
  2294.    89    y (lower case "y"; for upper case use 512 + 89, i.e., Shift+"y")
  2295.    90    z (lower case "z"; for upper case use 512 + 90, i.e., Shift+"z")
  2296.    96    NumPad 0 with NumLock ON
  2297.    97    NumPad 1 with NumLock ON
  2298.    98    NumPad 2 with NumLock ON
  2299.    99    NumPad 3 with NumLock ON
  2300.   100    NumPad 4 with NumLock ON
  2301.   101    NumPad 5 with NumLock ON
  2302.   102    NumPad 6 with NumLock ON
  2303.   103    NumPad 7 with NumLock ON
  2304.   104    NumPad 8 with NumLock ON
  2305.   105    NumPad 9 with NumLock ON
  2306.   106    NumPad * (asterisk) or "special" * on Northgate keyboard
  2307.   107    NumPad + (plus)
  2308.   108    Tech Ref says ' on NumPad (I couldn't duplicate it)
  2309.   109    NumPad - (minus; excellent choice for em-dash)
  2310.   110    NumPad . (period)
  2311.   111    NumPad / (slash)
  2312.   112    F1
  2313.   113    F2
  2314.   114    F3
  2315.   115    F4
  2316.   116    F5
  2317.   117    F6
  2318.   118    F7
  2319.   119    F8
  2320.   120    F9
  2321.   121    F10
  2322.   122    F11 (Tech Ref says Alt-F11=Alt-F1; Windows limitation)
  2323.   123    F12 (Tech Ref says Alt-F11=Alt-F1; Windows limitation)
  2324.   124    F13 (Tech Ref says Alt-F11=Alt-F1; Windows limitation)
  2325.   125    F14 (Tech Ref says Alt-F11=Alt-F1; Windows limitation)
  2326.   126    F15 (Tech Ref says Alt-F11=Alt-F1; Windows limitation)
  2327.   127    F16 (Tech Ref says Alt-F11=Alt-F1; Windows limitation)
  2328.   186    Guy says this is a semicolon (I couldn't duplicate it)
  2329.   187    Guys says = (Equals); I get + (Plus)
  2330.   188    Guy says this is a comma (I couldn't duplicate it)
  2331.   189    - (hyphen)
  2332.   190    Guy says this is a period (I couldn't duplicate it)
  2333.   191    Guy says this is a slash (I couldn't duplicate it)
  2334.   192    Guy says this is the ` (I couldn't duplicate it)
  2335.   219    Guy says this is the [ (I couldn't duplicate it)
  2336.   220    Guy says this is the backslash \ (I couldn't duplicate it)
  2337.   221    Guy says this is the ] (I couldn't duplicate it)
  2338.   222    Guy says this is the ' (I couldn't duplicate it)]
  2339.  
  2340. :MacroAssignToMenu
  2341.  
  2342. Syntax:  MacroAssignToMenu [Name$], [Menu$], [MenuText$], [Context] 
  2343.  
  2344. Equivalent to the Assign To Menu command on the Macro menu. 
  2345.  
  2346. Assigns the macro Name$ to the specified Menu$ with MenuText$. Menu$ can be File, Edit, View, Insert, Format, Utilities, Macro, or Window. 
  2347.  
  2348. Context is 0 (zero) for global or 1 for document template.
  2349.  
  2350. Assign is the default action. You can append the ResetAll or UnAssign command button name to return the menu assignments to the default state or remove a macro from a menu.
  2351.  
  2352. :MacroDesc$
  2353.  
  2354.   [HACKER'S GUIDE ALERT: >  This is an undocumented - but very much present! - WinWord command.  It's apparently related to the description displayed in the status bar when you select a macro; why it's undocumented, and how it's used, I dunno.]
  2355.  
  2356. :MacroEdit
  2357.  
  2358. Syntax:  MacroEdit Name$, [Context], [Description$], [ShowAll], [NewName$] 
  2359.  
  2360. Equivalent to the Edit command on the Macro menu. Displays the Name$ macro for editing. Context is 0 (zero) for global (default) or 1 for document template. The Description$ refers to the text that appears in the status bar if the macro is assigned to a menu. 
  2361.  
  2362. The ShowAll argument lists all Word commands as well as the macros you have created. 
  2363.  
  2364. If one of the command button names Rename, Delete, or Set is used and followed by another action, multiple MacroEdit commands are recorded.
  2365.  
  2366. The NewName$ agrument specifies a new name for the macro; this argument is used with the Rename command button. 
  2367.  
  2368. :MacroName$()
  2369.  
  2370. Syntax:  A$ = MacroName$(Count, [Context], [All]) 
  2371.  
  2372. Returns the name of the macro defined in the given context. Count may be in the range of 1 to CountMacros(Context). The name is taken from the list in the given context. MacroName$(0) gives the name of the current macro window, if any. Context is 0 (zero) for global or 1 for document template. If All is True, built-in commands are included.
  2373.  
  2374. :MacroRecord
  2375.  
  2376. Syntax:  MacroRecord [Name$], [Context], [Description$]
  2377.  
  2378. Equivalent to the Record Macro command on the File menu and the Record command on the Macro menu. Starts the macro recorder. If Name$ is not given, the next default recording name (Macron) is used. Context is 0 (zero) for global default) or 1 for document template. The Description$ refers to the text that appears in the status bar if the macro is assigned to a menu.     [HACKER'S GUIDE ALERT: >  There appears to be no way to turn the macro recorder off from inside WordBASIC.  You can pause it, however.  Refer to PauseRecord.]
  2379.  
  2380. :MacroRun
  2381.  
  2382. Syntax:  MacroRun Name$, [ShowAll]
  2383.  
  2384. Equivalent to the Run command on the Macro menu. Runs the named macro or command. If ShowAll is 1, built─in commands are included.
  2385.  
  2386.   [HACKER'S GUIDE ALERT: >  Is this command ever necessary?)
  2387.  
  2388. When writing macros, you will find that using Macro Run will consume much more memory than when using one macro with many subroutines. There is much more overhead (memory used) as a result of doing "macro run" versus calling a subroutine. 
  2389.  
  2390. If you execute MacroRun of a macro stored in a template and the active window is not associated with that template, the driver macro simply stops. 
  2391.  
  2392. One solution: save the current window name and Activate the template window before executing MacroRun. On return, Activate the saved window name:
  2393.  
  2394.      Sub TemplateMacroRun(TemplateWindow$, MacroName$, XSaveAll)
  2395.           SaveWindowName$ = WindowName$()
  2396.           Activate TemplateWindow$
  2397.           MacroRun MacroName$, XSaveAll
  2398.           Activate SaveWindowName$
  2399.      End Sub
  2400.  
  2401. It works pretty well unless the macro you execute closes the previously active window. This method also allows you to execute macros from a number of different templates.]
  2402.  
  2403. :MenuMode
  2404.  
  2405. Syntax:  MenuMode
  2406.  
  2407. Activates menu mode. Equivalent to pressing Alt or F10. 
  2408.  
  2409. :Mid$()
  2410.  
  2411. Syntax:  Num = Mid$(A$, n, [m]) 
  2412.  
  2413. Returns m characters from A$, starting at character n. If m is not supplied, the rest of the string is returned.
  2414.  
  2415. Funtion            Return value 
  2416. ------------            --------------------
  2417. Print Mid$("12345678", 2, 3)          234
  2418.  
  2419. :MkDir
  2420.  
  2421. Syntax:  MkDir Name$
  2422.  
  2423. Creates the directory specified by DirName$. 
  2424.  
  2425. :MoveText
  2426.  
  2427. Syntax:  MoveText
  2428.  
  2429. Moves text. Equivalent to pressing F2.
  2430.  
  2431. To use this statement:
  2432. 1    Make a selection.
  2433. 2    Run MoveText.
  2434. 3    Position the insertion point where you want to move the text.
  2435. 4    Run OK (press Enter).
  2436.  
  2437. :MsgBox   (See MsgBox() for Hacker's Guide notes)
  2438.  
  2439. Syntax:  MsgBox Message$, Title$, Type
  2440.  
  2441. Creates a message box displaying Message$. 
  2442.  
  2443. Title$ is the title of the message box. If it is not supplied, "Microsoft Word" is the title of the message box. Type determines the symbol and buttons displayed in the box. It is the sum of a value from the following groups:
  2444.  
  2445. Type arg    Displays
  2446. --------------     --------------
  2447. Button:
  2448.     0            OK button (default)
  2449.     1            OK and Cancel buttons
  2450.     2            Abort, Retry, Ignore buttons
  2451.     3            Yes, No, Cancel buttons
  2452.     4            Yes and No buttons
  2453.     5            Retry and Cancel buttons
  2454.  
  2455. Icons:
  2456.     0           No icon (default)
  2457.    16          Hand icon
  2458.    32          Question icon
  2459.    48          Exclamation icon
  2460.    64          Asterisk icon
  2461.  
  2462. Button action:
  2463.     0           First button is the default (default)
  2464.   256         Second button is the default
  2465.   512         Third button is the default
  2466.  
  2467. If Type is negative, then the message is displayed in the status bar and Type must be the sum of -1 (display the message permanently), -2 (display until a mouse or key event occurs), or -8 (use the entire status bar width). 
  2468.  
  2469. :MsgBox()
  2470.  
  2471. Syntax:  Num = MsgBox()
  2472.  
  2473. Returns one of the following values: 
  2474.  
  2475.    Return   Button pressed   Button text
  2476.    ----------   -------------------------    -----------------
  2477.    -1           Leftmost button   OK, Yes, Abort
  2478.     0           Next button          Cancel, No, Retry
  2479.     1           Next button          Cancel, Ignore
  2480.  
  2481.   [HACKER'S GUIDE ALERT: >  Maximum Message$ and Title$ length is 255 characters.  The "Attention icon" is a big exclamation point.  The "Information icon" is a lower-case "i" with a circle around it.   Quite some time ago - when I was just learning WordBASIC - I tried negative values for Type.  They didn't work for me back then.  It's easier to use Print anyway.  Note that the cancel button here is fundamentally different from the one in a Dialog Box.  If the user clicks CANCEL in a MsgBox, no OnError condition is raised.  Rather, you have to test the returned value of MsgBox() to see which button was clicked.]
  2482.  
  2483. :Name
  2484.  
  2485. Syntax:  Name OldName$ As NewName$
  2486.  
  2487. Renames a file.
  2488.  
  2489. STATMENT:  Name "COGS.DOC" As "COGS88.DOC"
  2490. EFFECT:    Renames the file COGS.DOC as COGS88.DOC
  2491.  
  2492. STATEMENT  Name "COGS.DOC" As "COGS.RTF"
  2493. EFFECT:    Renames the file COGS.DOC as COGS.RTF (does not change the file format)
  2494.  
  2495. :Next
  2496.  
  2497. See "For"
  2498.  
  2499. :NextCell
  2500.  
  2501. Syntax:  NextCell
  2502.  
  2503. Moves the selection to the beginning of the next cell in a table.
  2504.   [HACKER'S GUIDE ALERT: >  NextCell not only moves the cursor to the next cell, it selects the contents of the next cell as well. It's a bit strange because it doesn't work like all the other functions -LineDown, CharRight, that sort of stuff.  And there's no CellDown or CellUp.
  2505.  
  2506. Anyway, I needed to test for an empty cell.  Tried all sorts of things, but this finally worked (!).......]
  2507.  
  2508. :NextCell()
  2509.  
  2510. Syntax:  Log = NextCell()
  2511.  
  2512. Moves to the next cell. Returns 0 (zero) if there is no next cell.
  2513.  
  2514. :NextField
  2515.  
  2516. Syntax:  NextField
  2517.  
  2518. Moves the selection to the next field result. Skips over marker fields, such as Index Entry fields.
  2519.  
  2520. :NextField()
  2521.  
  2522. Syntax:  Log = NextField()
  2523.  
  2524. Moves to the next field. Returns 0 (zero) if there is no next field.
  2525.  
  2526. :NextObject
  2527.  
  2528. Syntax:  NextObject
  2529.  
  2530. Selects the next object in print preview or moves to the next text area in page view.
  2531.  
  2532. :NextObject()
  2533.  
  2534. Syntax:  Log = NextObject()
  2535.  
  2536. Moves to the next positioned object. Returns 0 (zero) if there is no next object.
  2537.  
  2538. :NextPage
  2539.  
  2540. Syntax:  NextPage
  2541.  
  2542. Moves the insertion point to the beginning of the next page in page view.
  2543.  
  2544. :NextPage()
  2545.  
  2546. Syntax:  Log = NextPage() 
  2547.  
  2548. Moves the insertion point to the beginning of the next page. Returns 0 (zero) if there is no next page.
  2549.  
  2550. :NextTab()
  2551.  
  2552. Syntax:  Num = NextTab(Pos) 
  2553.  
  2554. Returns the position of the next tab stop to the right of Pos.  Pos is a floating-point number given in points. If more than one paragraph is selected and the tabs do not all match, -1 is returned.
  2555.  
  2556. :NextWindow
  2557.  
  2558. Syntax:  NextWindow
  2559.  
  2560. Moves the selection to the next document window.
  2561.  
  2562. :NormalStyle
  2563.  
  2564. Syntax:  NormalStyle
  2565.  
  2566. Formats the selection in Normal paragraph format.
  2567.  
  2568. :NormalStyle()
  2569.  
  2570. Syntax:  Num = NormalStyle() 
  2571.  
  2572. Returns 1 if all of the selection has the Normal style, 0 (zero) if none of the selection has the Normal style, and -1 if part of the selection has the Normal style.
  2573.  
  2574. :OK
  2575. Syntax:  OK
  2576.  
  2577. Terminates a copy or move operation and performs its action. 
  2578.  
  2579. :OKButton and CancelButton 
  2580.  
  2581. Syntax:  OKButton x, y, dx, dy 
  2582. Syntax:  CancelButton x, y, dx, dy 
  2583.  
  2584. If you choose the OK button, the macro continues. If you choose the Cancel button, an error is generated. This error can be trapped with On Error (see Macros: Introduction).
  2585.  
  2586. :On Error
  2587.  
  2588. Syntax:  On Error Goto Label
  2589. Syntax:  On Error Resume Next
  2590. Syntax:  On Error Goto 0
  2591.  
  2592. The On Error control structure allows the programmer to "trap" an error so that the program can perform its own error handling. For more information on On Error, see Macros: Introduction  
  2593.  
  2594. :OnTime
  2595.  
  2596. Syntax:   OnTime When$, Name$, [Tolerance]
  2597.  
  2598. Executes the macro specified by Name$ at the time specified by When$. When$ is a text representation of the time for execution in a 24-hour format. When$ can also include a date string that precedes the time string. If the date is not specified, the macro is run at the first occurence of the specified time. The macro is executed the next time Word is idle after the specified When$. Word does not run the macro if more than Tolerance seconds have elapsed since When$, and the macro has not yet run. If Tolerance is 0 (zero), or not supplied, Word will always run the macro, regardless of how long it is before Word is idle and can run the macro.
  2599.  
  2600.   [HACKER'S GUIDE ALERT: >  This section of the Tech Ref desperately needs re-writing.
  2601. When$ can be in one of two formats, either "12:34" or "12:34:56".  You must have the colon in the right place.  You must have precisely two digits for the hour, two for the minute, and (if you use seconds), two for the second.  It's all on a military-style 24-hour clock.  So, 8:15 a.m. is "08:15", and 8:15 p.m. is "20:15"; two minutes past midnight is "00:02".  WARNING: there was an autobackup macro circulating at one point that failed to "flop over" from 23:59 to 00:00 - it went to 24:00.  (Guess that's what you get for running autobackups between midnight and 1 am!)  o repeat the Tech Ref, for emphasis - you can have just ONE OnTime macro running.  If you start another OnTime macro, the first one is clobbered completely, without any warning.  When$ and Name$ are limited to 255 characters.]
  2602.  
  2603. :Open
  2604.  
  2605. Syntax:  Open Name$ For Mode$ As [#]StreamNumber  
  2606.  
  2607. Opens the file or device specified by Name$. The Name$ can be a device such as Com1 or Lpt1, and must be enclosed in quotation marks. Do not include the colon following the device name.    [HACKER'S GUIDE ALERT: >  Name$ is limited to a maximum of 255 characters.  An example:
  2608.  
  2609.     Open "lpt1" for Output As #1
  2610.     Print #1, "Foobar"]
  2611.  
  2612. :OpenUpPara
  2613.  
  2614. Syntax:  OpenUpPara
  2615.  
  2616. Adds one line of space before the current paragraph.
  2617.  
  2618. :OptionGroup and OptionButton
  2619.  
  2620. Syntax:  OptionGroup .Field 
  2621. Syntax:  OptionButton x, y, dx, dy, Text$ 
  2622.  
  2623. OptionGroup begins the definition of a series of related option buttons. Within the group only one button may be active (on) at a time. The .Field argument is set to a value between 0 (zero) and n, which represents the value of the currently active button.
  2624.  
  2625. OptionGroup .brk
  2626. OptionButton 63, 36, 24, 12, "&PageBreak" 
  2627. OptionButton 63, 47, 24, 12,  "&LineBreak".
  2628.  
  2629. (HACKER'S GUIDE ALERT:>.Text$ field is req'd even if you're only using the button to set up a fancy text box.  A fancy TextBox is one that has an OptionButton right in front of it, so the user chooses the option, and specifies text in the same dialog box.)
  2630.  
  2631. :OtherPane
  2632.  
  2633. Syntax:  OtherPane
  2634.  
  2635. Moves the selection to the other pane of the current window. 
  2636.  
  2637. :OutlineCollapse
  2638.  
  2639. Syntax:  OutlineCollapse
  2640.  
  2641. Collapses the lowest level of subtext levels under the selected heading. 
  2642.  
  2643. :OutlineDemote
  2644.  
  2645. Syntax:  OutlineDemote
  2646.  
  2647. Increases the heading level of the selection by one. 
  2648.  
  2649. :OutlineExpand
  2650.  
  2651. Syntax:  OutlineExpand 
  2652.  
  2653. Expands the lowest level of subtext under the selected heading. 
  2654.  
  2655. :OutlineLevel()
  2656.  
  2657. Syntax:  Num = OutlineLevel()
  2658.  
  2659. Returns the heading level of the specified paragraph. Returns 0 (zero) if the specified paragraph doesn't have a defined level (body text, for example).
  2660.  
  2661. :OutlineMoveDown
  2662.  
  2663. Syntax:  OutlineMoveDown
  2664.  
  2665. Moves the selection below the next visible heading.
  2666.  
  2667. :OutlineMoveUp
  2668.  
  2669. Syntax:  OutlineMoveUp
  2670.  
  2671. Moves the selection above the next visible heading.
  2672.  
  2673. :OutlinePromote
  2674.  
  2675. Syntax:  OutlinePromote
  2676.  
  2677. Decreases the heading level of the selection by one. 
  2678.  
  2679. :OutlineShowFirstLine
  2680.  
  2681. Syntax:  OutlineShowFirstLine [On]
  2682.  
  2683. Toggles the state. Changes the view of non─heading level text between all text shown and only first line of text shown. 
  2684.  
  2685. :Overtype
  2686.  
  2687. Syntax:  Overtype [On]
  2688.  
  2689. Without the argument, toggles overtyping mode. If On is nonzero, overtype mode is activated and OVR is displayed in the status bar. If On is 0 (zero), overtype mode is deactivated.
  2690.  
  2691. :Overtype()
  2692.  
  2693. Syntax:  Log = Overtype()
  2694.  
  2695. Returns -1 if overtype mode is on, 0 (zero) if overtype mode is off.
  2696.  
  2697. :PageDown
  2698.  
  2699. Syntax:  PageDown [Repeat], [Select]
  2700.  
  2701. Moves the selection down by Repeat screens. If the Repeat argument is omitted, 1 is assumed. If Select is nonzero, the selection is extended down by Repeat screens. Equivalent to the PgDn key. If Select is 0 (zero) or omitted, the selection is not extended. 
  2702.  
  2703.    Statement           Effect
  2704.    ----------------           ----------
  2705.    PageDown 1, 1   Extends the selection down one screen from the insertion point.
  2706.  
  2707. :PageDown()
  2708.  
  2709. Syntax:  Log = PageDown ([Repeat], [Select]) 
  2710.  
  2711. Moves the selection down by Repeat pages. Returns -1 if operation was successful, returns 0 (zero) if not.
  2712.  
  2713. :PageUp
  2714.  
  2715. Syntax:  PageUp [Repeat], [Select]
  2716.  
  2717. Moves the selection up by Repeat screens. If the Repeat argument is omitted, 1 is assumed. If Select is nonzero, the selection is extended up by Repeat screens. Equivalent to the PgUp key. If Select is 0 (zero) or omitted, the selection is not extended. 
  2718.  
  2719.    Statement     Effect
  2720.    ----------------     ---------
  2721.    PageUp 20   Moves the selection point up 20 screens from the insertion point, but does not extend the selection
  2722.  
  2723. :PageUp()
  2724.  
  2725. Syntax:  Log = PageUp ([Repeat], [Select]) 
  2726.  
  2727. Moves the selection up by Repeat pages.  Returns -1 if operation was successful, returns 0 (zero) if not.
  2728.  
  2729. :ParaDown
  2730.  
  2731. Syntax:  ParaDown [Repeat], [Select] 
  2732.  
  2733. Moves the selection down by Repeat paragraphs.  If Repeat is omitted, 1 is assumed. If Select is nonzero, the selection is extended down by Repeat paragraphs.
  2734.  
  2735. :ParaDown()
  2736.  
  2737. Syntax:  Log = ParaDown ([Repeat], [Select]) 
  2738.  
  2739. Moves the selection down by Repeat paragraphs. Returns 0 (zero) if the action cannot be performed. For example, the function returns 0 if the insertion point is at the end of the document. 
  2740.  
  2741. :ParaUp
  2742.  
  2743. Syntax:  ParaUp [Repeat], [Select] 
  2744.  
  2745. Moves the selection up by Repeat paragraphs, If Repeat is omitted, 1 is assumed. If Select is nonzero, the selection is extended up by Repeat paragraphs.
  2746.  
  2747. :ParaUp()
  2748.  
  2749. Syntax:  Log = ParaUp([Repeat], [Select]) 
  2750.  
  2751. Moves the selection up by Repeat paragraphs. Returns 0 (zero) if the action cannot be performed. For example, the function returns 0 if the insertion point is at the beginning of the document. 
  2752.  
  2753. :PauseRecorder
  2754.  
  2755. Syntax:  PauseRecorder
  2756.  
  2757. Stops macro recording until PauseRecorder is executed again. 
  2758.  
  2759. :PrevCell
  2760.  
  2761. Syntax:  PrevCell
  2762.  
  2763. Moves the selection to the previous cell.
  2764.  
  2765. :PrevCell()
  2766.  
  2767. Syntax:  Log = PrevCell()
  2768.  
  2769. Moves to the previous cell. Returns 0 (zero) when the selection is in the first cell.
  2770.  
  2771. :PrevField
  2772.  
  2773. Syntax:  PrevField
  2774.  
  2775. Moves the selection to the previous field.
  2776.  
  2777. :PrevField()
  2778.  
  2779. Syntax:  Log = PrevField()
  2780.  
  2781. Moves to the previous field. Returns 0 (zero) when the selection is in the first field.
  2782.  
  2783. :PrevObject
  2784.  
  2785. Syntax:  PrevObject
  2786.  
  2787. Selects the previous object in print preview or moves to the previous text area in page view.
  2788.  
  2789. :PrevObject()
  2790.  
  2791. Syntax:   Log = PrevObject()
  2792.  
  2793. Moves to the previous object. Returns 0 (zero) when the selection is at the first object or text area.
  2794.  
  2795. :PrevPage
  2796.  
  2797. Syntax:  PrevPage
  2798.  
  2799. In page view, moves the insertion point to the beginning of the previous actual page.
  2800.  
  2801. :PrevPage()
  2802.  
  2803. Syntax:  Log = PrevPage()
  2804.  
  2805. Moves to the previous page. Returns 0 (zero) when the selection is at the first actual page. 
  2806.  
  2807. :PrevTab()
  2808.  
  2809. Syntax:  Log = PrevTab(Pos) 
  2810.  
  2811. Returns the position of the next tab to the left of Pos.  Pos is a floating-point number given in points. If more than one paragraph is selected and the tabs do not all match, -1 is returned.
  2812.  
  2813. :PrevWindow
  2814.  
  2815. Syntax:  PrevWindow
  2816.  
  2817. Activates the previously active window.
  2818.  
  2819. :Print
  2820.  
  2821. Syntax:  Print [[#]StreamNumber], Expression 
  2822.  
  2823. Writes Expression to the file specified by StreamNumber.  With no StreamNumber specified, output goes to the status bar.    [HACKER'S GUIDE ALERT: >  ]Expression is limited to a total of 255 characters.  This Print statement works like most other BASIC print statements, e.g., there is a carriage return appended to the end of each print Expression unless the Expression ends with a semicolon.
  2824.  
  2825. :Read
  2826.  
  2827. Syntax: Read [#]StreamNumber, VariableName(s) 
  2828.  
  2829. Similar to the Input statement, but removes quotation marks for strings.  This statement is used with the Write statement.
  2830.  
  2831. :RecordNextCommand
  2832.  
  2833. Syntax:  RecordNextCommand
  2834.  
  2835. Records the next command at the insertion point in the current macro window.
  2836.  
  2837. :Redim
  2838.  
  2839. Syntax:  [Shared] Var [(Size)] [, Var [(Size)...]
  2840.  
  2841. Realocates storage space for a previously defined variable array.  May be used to enlarge an array, but the contents will be lost.  Redim can also be employed to resue a previously defined dialog record.
  2842.  
  2843.   [HACKER'S GUIDE ALERT: >  The only way that's been found to "pass" an array to a Function or subroutine uses Redim.  Uh.... judiciously, shall we say?  Try this:
  2844.  
  2845.       Dim Shared Array(0)
  2846.       Sub Main
  2847.       Redim SharedArray(500)
  2848.       ......
  2849.       B=SumArray(500)
  2850.       ......
  2851.       End Sub
  2852.  
  2853.    Function SumArray(MaxArrayIndex)
  2854.    For i=0 to MaxArrayIndex
  2855.        N=N + SharedArray(i)
  2856.    Next i
  2857.    SumArray=N
  2858.    EndFunction          ]
  2859.  
  2860. :Rem
  2861.  
  2862. Syntax:  REM Remarks
  2863. Syntax:  'Remarks
  2864.  
  2865. Inserts explanatory text into the macro. You can use an apostrophe (') instead of a REM statement.  If a REM statement follows other statements on a line, it must be separated from those statements by a colon (:).  A colon is not required before a remark introduced by an apostrophe.
  2866.  
  2867. :RenameMenu
  2868.  
  2869. Syntax:  RenameMenu MenuNumber, NewText$  
  2870.  
  2871. Renames the top level menu of Menu Number to New Text$. MenuNumber represents the name of a menu. NewText$ replaces the menu name. An ampersand (&) preceding a character makes it the keyboard equivalent to selecting from the menu. For example, "&Programs" becomes Programs when this statement is executed.
  2872.  
  2873. STATEMENT:  RenameMenu 5, "&Other Tasks" 
  2874. EFFECT:     Changes Utilities to Other Tasks 
  2875.  
  2876.     [HACKER'S GUIDE ALERT: >  NewText$ is limited to 255 characters.  If you rename a menu with a long name, the menu bar will jump to two (maybe more?) lines.  But, no, there is no way to add another - ninth - menu.  All you get is numbers 0 thru 7.]
  2877.  
  2878. The MenuNumber argument values are: 
  2879.  
  2880.    MenuNumber   Menu
  2881.    ---------------------    -----------
  2882.        0                  File
  2883.        1                  Edit
  2884.        2                  View
  2885.        3                  Insert
  2886.        4                  Format
  2887.        5                  Utilities
  2888.        6                  Macro
  2889.        7                  Window
  2890.  
  2891. :Repeat
  2892.  
  2893. Syntax:  Repeat
  2894.  
  2895. Repeats the last command. 
  2896.  
  2897. :RepeatSearch
  2898.  
  2899. Syntax:  RepeatSearch
  2900.  
  2901. Repeats the most recent search.
  2902.  
  2903. :ResetChar
  2904.  
  2905. Syntax:  ResetChar
  2906.  
  2907. Removes manual character formatting from the selected text. Manual character formatting is formatting that is not applied as a style. For example, you manually format a word or phrase in a paragraph as bold text if the paragraph style is normal text. The text is left with the character formatting of the current style.
  2908.  
  2909. :ResetChar()
  2910.  
  2911. Syntax:  Num = ResetChar()
  2912.  
  2913. Returns 1 if the selected text contains no manual character formatting. Returns 0 (zero) if any manual character formatting is present.
  2914.  
  2915. :ResetFootnoteContNotice
  2916.  
  2917. Syntax:  ResetFootnoteContNotice
  2918.  
  2919. Resets the footnote continuation notice to the default value. 
  2920.  
  2921. :ResetFootnoteContSep
  2922.  
  2923. Syntax:  ResetFootnoteContSep
  2924.  
  2925. Resets the footnote continuation separator to the default value.
  2926.  
  2927. :ResetFootnoteSep
  2928.  
  2929. Syntax:  ResetFootnoteSep
  2930.  
  2931. Resets the footnote separator to the default value.
  2932.  
  2933. :ResetPara
  2934.  
  2935. Syntax:  ResetPara
  2936.  
  2937. Removes manual paragraph formatting from the selected text. The text is left with the paragraph formatting of the current style.
  2938.  
  2939. :ResetPara()
  2940.  
  2941. Syntax:  Num = ResetPara()
  2942.  
  2943. Returns 1 if the selected text contains no manual paragraph formatting. Returns 0 (zero) if any manual paragraph formatting is present.
  2944.  
  2945. :Right$()
  2946.  
  2947. Syntax:  A$ = Right$(A$, n) 
  2948.  
  2949. Returns the rightmost n characters of A$.
  2950.  
  2951.    Function                    Return value
  2952.    ----------------                 ----------------------
  2953.    A$ = "Legal File List"
  2954.    Print Right$(A$,4)            "List"
  2955.  
  2956.    A$ = "Legal File List"
  2957.    Print Right$(A$,9)            "File List"
  2958.  
  2959. :RightPara
  2960.  
  2961. Syntax:  RightPara
  2962.  
  2963. Right aligns the selected paragraphs.
  2964.  
  2965. :RightPara()
  2966.  
  2967. Syntax:  Num = RightPara()
  2968.  
  2969. Returns 0 (zero) if none of the selected paragraphs are right aligned, 1 if all of the selected paragraphs are right aligned, or -1 if more than one kind of paragraph alignment is used. 
  2970.  
  2971. :RmDir
  2972.  
  2973. Syntax:  RmDir Name$  
  2974.  
  2975. Removes the specified directory or subdirectory. Files must first be removed from the subdirectory for this statement to work. 
  2976.  
  2977. :Rnd()
  2978.  
  2979. Syntax:  Num = Rnd([Expression]) 
  2980.  
  2981. Returns a random fractional value between 0 (zero) and 1. The Expression is not used by WordBASIC, but is provided for compatibility with other forms of BASIC.
  2982.  
  2983. :RulerMode
  2984.  
  2985. Syntax:  RulerMode
  2986.  
  2987. Switches to ruler mode. 
  2988.  
  2989. :SaveTemplate
  2990.  
  2991. Syntax:  SaveTemplate
  2992.  
  2993. Saves the document's template.  If the document has no template, saves Normal.dot.
  2994.  
  2995. :Seek
  2996.  
  2997. Syntax:  Seek [#]StreamNumber, Count 
  2998.  
  2999. Positions file pointer at character Count in the file attached to stream StreamNumber. 
  3000.  
  3001. :Seek()
  3002.  
  3003. Syntax:  Num = Seek([#]StreamNumber) 
  3004.  
  3005. Returns the current file pointer for the specified StreamNumber. 
  3006.  
  3007. :Select Case...Case Else   End Select
  3008.  
  3009. Syntax:   Select Case Expression
  3010.                      Case CaseExpression
  3011.                           Statement(s)
  3012.                      [Case Else
  3013.                           Statement(s)]
  3014.                 End Select
  3015.  
  3016. The expression is compared with all the values given in each CaseExpression until a match is found. If a match is found, the statement(s) following the CaseExpression are executed. If there is no match and there is a Case Else, those statement(s) are executed. 
  3017.  
  3018.   [HACKER'S GUIDE ALERT: >  Ever wonder why your macros pop up a box that say "Select Without End Select"?  It's because of a "design feature" of the Select statement.  WinWord has to "execute" an End Select prior to finishing a macro - otherwise the bogus "Select Without End Select" box pops up.  For example, this will give you a bogus message:
  3019.  
  3020.    Select Case N
  3021.     Case 1
  3022.         Goto Bye
  3023.     Case Else
  3024.    End Select
  3025.    DoStuff
  3026.   Bye:
  3027.   End Sub
  3028.  
  3029. But if you just change it a little bit, you won't get that stupid message:
  3030.  
  3031.    Select Case N
  3032.     Case 1
  3033.         Flag=-1
  3034.     Case Else
  3035.    End Select
  3036.    If Flag Goto Bye
  3037.    DoStuff
  3038.    Bye:
  3039.    End Sub                     ]
  3040.  
  3041. :Selection$()
  3042.  
  3043. Syntax:  A$ = Selection$()
  3044.  
  3045. Returns the plain, unformatted text of the selection. The maximum limit on the selection is 32,000 characters or until memory runs out. If the selection is too large, Selection$() is filled with as much of the selection as will fit, and an error is generated. If the selection is an insertion point, the character following the insertion point is returned.
  3046.  
  3047. :SelectTable
  3048.  
  3049. Syntax:  SelectTable 
  3050.  
  3051. Selects the table containing the insertion point. 
  3052.  
  3053. :SelType
  3054.  
  3055. Syntax:  SelType Type 
  3056.  
  3057. Changes the selection highlighting to Type. Type refers to one of the following:
  3058.  
  3059.    Type    Selection Type
  3060.    -------     ------------------------
  3061.       0       Hidden text 
  3062.       1       Insertion point
  3063.       2       Selection
  3064.       4       Dotted selection or insertion point (whatever is current) 
  3065.       5       Dotted insertion point 
  3066.       6       Dotted selection 
  3067.  
  3068. :SelType()
  3069.  
  3070. Syntax:  Num = SelType() 
  3071.  
  3072. Returns the type of the selection highlighting. 
  3073.  
  3074.    Selection             Function returns
  3075.    ---------------             --------------------------
  3076.    Hidden text                     0
  3077.    Insertion point                 1
  3078.    Selection                         2
  3079.    Dotted insertion
  3080.        point or selection
  3081.        (whatever is current)   4
  3082.    Dotted insertion point      5
  3083.    Dotted selection              6
  3084.  
  3085. :SendKeys
  3086.  
  3087. Syntax:  SendKeys Keys$, Wait
  3088.  
  3089. Sends the keys specified to the active application, just as if they were typed at the keyboard. If Word is not the active application and Wait is -1, Word waits for all keys to be processed before proceeding.   Keys$ is represented by one or more characters, such as a for the character a, {Enter} for the Enter key, and {33} for PgUp.   To specify characters that aren't displayed when you press the key, use the codes shown in the following table.
  3090.  
  3091.     Key              Code
  3092.     ------               ----------------
  3093. Backspace      {backspace} or {bs} or {bksp}
  3094.     Break          {break}
  3095.     CapsLock    {capslock}
  3096.     Clear           {clear}
  3097.      Del             {delete} or {del}
  3098.      Down          {down}
  3099.      End             {end}
  3100.     Enter            {enter}
  3101.     Esc              {escape} or {esc}
  3102.     Help             {help}
  3103.     Home           {home}
  3104.     Ins               {insert}
  3105.     Left              {left}
  3106.     NumLock     {numlock}
  3107.     PgDn           {pgdn}
  3108.     PgUp           {pgup}
  3109.     PrtSc           {prtsc}
  3110.     Right           {right}
  3111.     Tab              {tab}
  3112.     Up               {up}
  3113.     FKey: F#     {F#}  (For example, F12 is {F12})
  3114.  
  3115. The plus sign (+), the percent sign (%), and the caret (^) have special meanings, described below.
  3116.  
  3117.    To combine with    Precede the key code by
  3118.    ---------------------------   -----------------------------------------
  3119.        Shift                   + (plus sign)
  3120.         Alt                     % (percent sign)
  3121.        Ctrl                     ^ (caret) 
  3122.  
  3123. For example, %{enter} sends the code for Alt+Enter. The code +(eb) specifies EB.
  3124.  
  3125. To repeat a key sequence, use the syntax {key  number}. For example, {pgdn 20} means press the PgDn key 20 times. Remember to put a space between the key and the number. 
  3126.  
  3127.   [HACKER'S GUIDE ALERT: >  Keys$ is limited to 255 characters.  SendKeys is nothing but a kludge.  But sometimes it's a necessary kludge.  In particular, it's an approach of last resort for situations where WinWord support is severely lacking - FilePrinterSetup being a good example.  SendKeys will not work (or at least it won't work the way you expect) when you are editing a macro, using the STEP button.  The keys you want to send may be surrounded by (), e.g., these are the same:
  3128.  
  3129.    SendKeys "help"
  3130.    SendKeys("help")
  3131.  
  3132. If you want to send a space, use brackets surrounding a space, e.g.
  3133.  
  3134.    SendKeys { }
  3135.  
  3136. will send a space (or simulate pressing the space bar, if you prefer).  To send a plus key, try
  3137.  
  3138.    SendKeys {Alt-043}
  3139.  
  3140. where Alt-043 is formed by turning ON NumLock, holding down Alt, typing 043 on the number pad, then releasing Alt.]
  3141.  
  3142. :SentLeft
  3143.  
  3144. Syntax:  SentLeft [Repeat], [Select]
  3145.  
  3146. Moves the insertion point left by Repeat number of sentences.  If Repeat is omitted, 1 is assumed.  If Select is nonzero, the selection is extended up by Repeat sentences.
  3147.  
  3148. :SentLeft()
  3149.  
  3150. Syntax:  Log = SentLeft([Repeat], [Select])
  3151.  
  3152. Moves the insertion point left by Repeat number of sentences.  If Repeat is omitted, 1 is assumed.  If Select is nonzero, the selection is extended up by repeat sentences.  Returns 0 (zero) if the action cannot be performed.  For example, the function returns 0 (zero) if the insertion point is at the beginning of the document.
  3153.  
  3154. :SentRight
  3155.  
  3156. Syntax:  SentRight[Repeat], [Select]
  3157.  
  3158. Moves the insertion point right by Repeat number of sentences.  If Repeat is omitted, 1 is assumed.  If Select is nonzero, the selection is extended up by Repeat sentences.
  3159.  
  3160. :SentRight()
  3161.  
  3162. Syntax:  Log = SentRight([Repeat], [Select])
  3163.  
  3164. Moves the insertion point right by Repeat number of sentences.  If Repeat is omitted, 1 is assumed.  If Select is nonzero, the selection is extended up by repeat sentences.  Returns 0 (zero) if the action cannot be performed.  For example, the function returns 0 (zero) if the insertion point is at the beginning of the document.
  3165.  
  3166. :SetDirty
  3167.  
  3168. Syntax:  SetDirty [Dirty]
  3169.  
  3170. Makes Word recognize the current document as "dirty," or a changed document. If Dirty is omitted or 1, the document is made dirty. If 0 (zero), it makes the document not dirty.
  3171.  
  3172. :SetEndOfBookmark
  3173.  
  3174. Syntax:  SetEndOfBookmark Bookmark1$, [Bookmark2$] 
  3175.  
  3176. Sets Bookmark2$ to the end point of Bookmark1$.  If Bookmark2$ is not supplied, Bookmark1$ is set to its own end. 
  3177.  
  3178. :SetGlossary
  3179.  
  3180. Syntax:  SetGlossary Name$, Text$, [Context]
  3181.  
  3182. Defines a glossary entry called Name$ containing the text Text$.  Context is 0 (zero) for global, 1 for document template.
  3183.  
  3184. The variables may be set prior to calling the statement as shown in the second example. Using variables makes it easier to change the definition if necessary. 
  3185.  
  3186. STATEMENT:  SetGlossary "Disclaim", "No warranty, either express or implied, is made by Trey Research." ,1
  3187. EFFECT:     Defines the glossary entry called Disclaim, with the template context, 
  3188. containing the specified text. 
  3189.  
  3190. STATEMENT:
  3191.    Text$ = "No warranty, either express orimplied, is made by Trey Research."
  3192.    SetGlossary "Disclaim", Text$, 1
  3193. EFFECT:     Defines the same glossary entry as in the first example, but uses the variable Text$. 
  3194.  
  3195.   [HACKER'S GUIDE ALERT: >  Glossary names are limited to a maximum of 255 characters.  You can use SetGlossary and GetGlossary to store variable values.
  3196.  
  3197.    Sub SetParam(Name$,Value$)
  3198.     SetGlossary Name$, Value$, 0
  3199.    End Sub
  3200.  
  3201.    Function GetParam$(Name$)
  3202.     GetPara$=GetGlossary$(Name$)
  3203.    End Function
  3204.  
  3205. The problem with this approach is that it sets NORMAL.DOT "dirty", i.e., IsDirty will be on, and the user will be prompted to save global glossary and command changes next time they exit WinWord.  However, if you keep track of whether NORMAL.DOT was dirty before you started storing values in the glossary, use the tip listed in the Hacker's Guide on Page 209 (IsDirty), and use SetDirty properly, there's no reason why you can't take advantage of this approach.  On the other hand, SetProfileString may be a cleaner way of doing what you want to do.]
  3206.  
  3207. :SetProfileString
  3208.  
  3209. Syntax:  SetProfileString [App$], Key$, Value$  
  3210.  
  3211. Sets a value in the current WIN.INI. 
  3212.  
  3213. App$ is the name of the Microsoft Windows application. If the application is not specified, the string [Microsoft Word] is used. 
  3214.  
  3215. :SetStartOfBookmark
  3216.  
  3217. Syntax:  SetStartOfBookmark Bookmark1$, [Bookmark2$]
  3218.  
  3219. Sets Bookmark2$ to the starting point of Bookmark1$.  If Bookmark2$ is not given, Bookmark1$ is set to its own start. 
  3220.  
  3221. :Sgn()
  3222.  
  3223. Syntax:  Num = Sgn(n) 
  3224.  
  3225. Returns the sign of n. Returns 1 for a positive number, -1 for a negative number, or 0 for zero.
  3226.  
  3227.    Function       Return value
  3228.    --------------      ----------------------
  3229.    Sgn(4)                  1
  3230.    Sgn(-14)              -1
  3231.    Sgn(0)                  0
  3232.  
  3233. :Shell
  3234.  
  3235. Syntax:  Shell App$, [WindowStyle]
  3236.  
  3237. Starts another program under Microsoft Windows. App$ uses the same format as the File Run command in the Windows MS-DOS Executive, including any switches or arguments that the program accepts. If App$ is the name of a file with an extension specific to an installed application (.DOC for a Word document, for example), the statement starts the application and loads that file.WindowStyle specifies how the window containing the program should appear, as follows:
  3238.  
  3239.    Mode    Window type
  3240.    ---------     ----------------------
  3241.      0          Minimized window; default
  3242.      1          Normal window
  3243.      2          Minimized window (for Microsoft Excel compatibility)
  3244.      3          Maximized window
  3245.      4          Deactivated window
  3246.  
  3247. STATEMENT:  Shell "EXCEL.EXE", 2
  3248. EFFECT:     Starts Microsoft Excel and minimizes the window 
  3249.  
  3250. STATEMENT:  Shell "TRENDS.XLC", 1
  3251. EFFECT:     Starts Microsoft Excel and loads the document TRENDS.XLC in a normal window
  3252.  
  3253. STATEMENT:  Shell "NOTEPAD.EXE TORT.TXT"
  3254. EFFECT:     Starts Notepad and loads the document TORT.TXT
  3255.  
  3256.   [HACKER'S GUIDE ALERT: >  App$ is limited to 255 characters.  To shell out to DOS, try
  3257.  
  3258. Shell "command.com /c"]
  3259.  
  3260. :ShowAll
  3261.  
  3262. Syntax:  ShowAll [On]
  3263.  
  3264. Without the argument, toggles ShowAll option of the View Preference command. If On is nonzero, shows all invisible objects such as hidden text, tabs, spaces, paragraph marks, and so on. If On is 0 (zero), turns off ShowAll option. 
  3265.  
  3266. :ShowAllHeadings
  3267.  
  3268. Syntax:  ShowAllHeadings 
  3269.  
  3270. Shows all text in outline view.
  3271.  
  3272. :ShowHeading1
  3273.  
  3274. Syntax:  ShowHeading1
  3275.  
  3276. Shows all Level 1 headings and hides subordinate headings. 
  3277.  
  3278. :ShowHeading2
  3279.  
  3280. Syntax:  ShowHeading2
  3281.  
  3282. Shows all Level 2 headings and hides subordinate headings. 
  3283.  
  3284. :ShowHeading3
  3285.  
  3286. Syntax:  ShowHeading3
  3287.  
  3288. Shows all Level 3 headings and hides subordinate headings. 
  3289.  
  3290. :ShowHeading4
  3291.  
  3292. Syntax:  ShowHeading4
  3293.  
  3294. Shows all Level 4 headings and hides subordinate headings. 
  3295.  
  3296. :ShowHeading5
  3297.  
  3298. Syntax:  ShowHeading5
  3299.  
  3300. Shows all Level 5 headings and hides subordinate headings. 
  3301.  
  3302. :ShowHeading6
  3303.  
  3304. Syntax:  ShowHeading6
  3305.  
  3306. Shows all Level 6 headings and hides subordinate headings. 
  3307.  
  3308. :ShowHeading7
  3309.  
  3310. Syntax:  ShowHeading7
  3311.  
  3312. Shows all Level 7 headings and hides subordinate headings. 
  3313.  
  3314. :ShowHeading8
  3315.  
  3316. Syntax:  ShowHeading8
  3317.  
  3318. Shows all Level 8 headings and hides subordinate headings. 
  3319.  
  3320. :ShowHeading9
  3321.  
  3322. Syntax:  ShowHeading9
  3323.  
  3324. Shows all Level 9 headings and hides subordinate headings. 
  3325.  
  3326. :ShowVars
  3327.  
  3328. Syntax:  ShowVars 
  3329.  
  3330. Displays the list of variables (and their values) currently in use. This statement is useful for debugging macros.
  3331.  
  3332. :ShrinkFont
  3333.  
  3334. Syntax:  ShrinkFont
  3335.  
  3336. Decreases the size of the selected font. Can be used either on the selection or at the insertion point.
  3337.  
  3338. :ShrinkSelection
  3339.  
  3340. Syntax:  ShrinkSelection
  3341.  
  3342. Shrinks the selection to the next smallest unit (word, sentence, paragraph, etc.). 
  3343.  
  3344. :SmallCaps
  3345.  
  3346. Syntax:  SmallCaps [On]
  3347.  
  3348. Without the argument, toggles small caps for the entire selection. If On is nonzero, makes the entire selection small caps. If On is 0 (zero), removes small caps from the entire selection.
  3349.  
  3350. :SmallCaps()
  3351.  
  3352. Syntax:  Num = SmallCaps()
  3353.  
  3354. Returns 0 (zero) if none of the selection is small caps, 1 if all of the selection is small caps, or -1 if part of the selection is small caps.
  3355.  
  3356. :SpacePara1
  3357.  
  3358. Syntax:  SpacePara1
  3359.  
  3360. Formats the selected paragraphs with single spacing.
  3361.  
  3362. :SpacePara1() 
  3363.  
  3364. Syntax:  Num = SpacePara1()
  3365.  
  3366. Returns 0 (zero) if none of the selected paragraphs are single-spaced, 1 if all of the selected paragraphs are single─spaced, or -1 if more than one kind of paragraph spacing is used. 
  3367.  
  3368. :SpacePara2
  3369.  
  3370. Syntax:  SpacePara2
  3371.  
  3372. Formats the selected paragraphs with double spacing.
  3373.  
  3374. :SpacePara2()
  3375.  
  3376. Syntax:  Num = SpacePara2()
  3377.  
  3378. Returns 0 (zero) if none of the selected paragraphs are double-spaced, 1 if all of the selected paragraphs are double-spaced, or -1 if more than one kind of paragraph spacing is used.
  3379.  
  3380. :SpacePara15
  3381.  
  3382. Syntax:  SpacePara15
  3383.  
  3384. Formats the selected paragraphs with one-and-one-half line spacing.
  3385.  
  3386. :SpacePara15()
  3387.  
  3388. Syntax:  Num = SpacePara15()
  3389.  
  3390. Returns 0 (zero) if none of the selected paragraphs are one-and-one-half spaced, 1 if all of the selected paragraphs are one-and-one─half spaced, or -1 if more than one kind of paragraph spacing is used.
  3391.  
  3392. :Spike
  3393.  
  3394. Syntax:  Spike
  3395.  
  3396. Deletes the selection after copying it to the special glossary called the Spike.    [HACKER'S GUIDE ALERT: >  WinWord adds a paragraph mark to the end of each selection that you place on the Spike.]
  3397.  
  3398. :StartOfColumn
  3399.  
  3400. Syntax:  StartOfColumn [Select] 
  3401.  
  3402. Moves insertion point to topmost position in the currently selected table column.
  3403.  
  3404. :StartOfDocument
  3405.  
  3406. Syntax:  StartOfDocument [Select]
  3407.  
  3408. Moves the selection to the beginning of the document. If Select is nonzero, extends the selection. 
  3409.  
  3410. :StartOfLine
  3411.  
  3412. Syntax:  StartOfLine [Select]
  3413.  
  3414. Moves the selection to the beginning of the line. If Select is nonzero, extends the selection. 
  3415.  
  3416. :StartOfRow
  3417.  
  3418. Syntax:  StartOfRow [Select] 
  3419.  
  3420. Moves insertion point to the leftmost position in the currently selected table row.
  3421.  
  3422. :StartOfWindow
  3423.  
  3424. Syntax:  StartOfWindow [Select]
  3425.  
  3426. Moves the insertion point to the top left corner of the window. If Select is nonzero, extends the selection. 
  3427.  
  3428. :StepMacro
  3429.  
  3430. Syntax:  StepMacro
  3431.  
  3432.   [HACKER'S GUIDE ALERT: >  Another undocumented Winword command.   Seems to work like the macro editor function.]
  3433.  
  3434. :StepMacroSUBs
  3435.  
  3436. Syntax:  StepMacroSUBs
  3437.  
  3438.   [HACKER'S GUIDE ALERT: >  Yet another undocumented Winword command.   Also seems to work like the macro editor function.]
  3439.  
  3440. :Stop
  3441.  
  3442. Syntax:  Stop
  3443.  
  3444. Stops a running macro and displays a message that the macro was interrupted.
  3445.  
  3446. :Str$()
  3447.  
  3448. Syntax:  A$ = Str$(n) 
  3449.  
  3450. Returns the string representation of value n.  Positive numbers have a leading space character. 
  3451.  
  3452. :String$()
  3453.  
  3454. Syntax:  A$ = String$(n, A$) 
  3455.  
  3456. Returns the first character in A$ repeated n times. Replacing A$ with the number m representing the ASCII value of A$ returns the character with ANSI code m 
  3457. repeated n times.
  3458.  
  3459.    Function            Return value
  3460.    --------------            ---------------------
  3461.    A$="Persistence of Vision"
  3462.    Print String$(5,A$)             PPPPP
  3463.    Print String$(5,100)             d
  3464.  
  3465. :StyleName$()
  3466.  
  3467. Syntax:  A$ = StyleName$([Count], [Context], [All]) 
  3468.  
  3469. Returns the name of the style defined in the given context (global or document template). Count may be in the range from 1 to CountStyle(Context).
  3470.  
  3471. If Count is 0 (zero), the name of the current style is returned; otherwise, the name is taken from the list in the given context. Context is 0 for global, 1 for document template.
  3472.  
  3473. :Sub/End Sub
  3474.  
  3475. Syntax:   Statement(s) Sub Name [ParameterList]
  3476.                End Sub
  3477.  
  3478. Defines a subroutine. For more information on subroutines, see Macros: Introduction. 
  3479.  
  3480. :SubScript
  3481.  
  3482. Syntax:  SubScript [On]
  3483.  
  3484. Without the argument, toggles subscript for the entire selection. If On is nonzero, makes the entire selection subscript. If On is 0 (zero), removes subscript from the entire selection.
  3485.  
  3486. :SubScript()
  3487.  
  3488. Syntax:  Num = SubScript()
  3489.  
  3490. Returns 0 (zero) if none of the selection is subscript, 1 if all of the selection is subscript, or -1 if part of the selection is subscript or superscript. 
  3491.  
  3492. :Super
  3493.  
  3494. Syntax:   Super Statement
  3495.  
  3496. Directs Word to run the named macro at the next context level.  For macros with the same name, Word runs the template macro before a global macro and a global macro before a built-in command.  Super overrides this order.  If, for  example, you have a macro named FilePrint, a Super FilePrint statement runs the built in command.     [HACKER'S GUIDE ALERT: >  That last sentence should read:
  3497.  
  3498. "If, for example, you have a global macro named FilePrint, a Super FilePrint statement runs the built-in command."  (The original wording is incorrect if you have both a global and a template macro named FilePrint.)  There was quite a discussion of Super in a recent PC Magazine article.  The article claimed that Super did nothing.  Horseradish.  The manual is right, PC Mag is wrong.  (That's mighty unusual, in my experience!)]
  3499.  
  3500. :SuperScript
  3501.  
  3502. Syntax:  SuperScript [On]
  3503.  
  3504. Without the argument, toggles superscript for the entire selection. If On is nonzero, makes the entire selection superscript. If On is 0 (zero), removes superscript from the entire selection.
  3505.  
  3506. :SuperScript()
  3507.  
  3508. Syntax:  Num = SuperScript()
  3509.  
  3510. Returns 0 (zero) if none of the selection is superscript, 1 if all of the selection is superscript, or -1 if part of the selection is superscript or subscript.
  3511.  
  3512. :TabLeader$()
  3513.  
  3514. Syntax:  A$ = TabLeader$(Pos) 
  3515.  
  3516. Returns the leader character of the tab at Pos.  If more than one paragraph is selected and all the tabs don't match, an empty string is returned. 
  3517.  
  3518. The leader characters returned are blank space, period, hyphen, and underscore. 
  3519.  
  3520. :TabType()
  3521.  
  3522. Syntax:  Num = TabType(Pos) 
  3523.  
  3524. Returns the type of tab at the given position Pos.  If more than one paragraph is selected and all the tabs don't match, -1 is returned. If the tabs match, the type is returned as follows:
  3525.  
  3526.    Returned    Tab type is
  3527.    --------------    -------------------
  3528.        0        Left-aligned
  3529.        1        Centered
  3530.        2        Right-aligned
  3531.        3        Decimal
  3532.  
  3533. :Text
  3534.  
  3535.  
  3536. Syntax:  Text x, y, dx, dy, Text$ 
  3537.               Text  7, 10, 21, 9, "&Text:" 
  3538.  
  3539. Creates a box of static text. Text does not have a result.     [HACKER'S GUIDE ALERT: >  Text$ is limited to 255 characters.  If you want an ampersand to show up you must double it.  I.e., &A will display as A   But &&A will display as &A]
  3540.  
  3541. :TextBox
  3542.  
  3543. Syntax:  TextBox x, y, dx, dy, .Field 
  3544.               TextBox 32,8,65,12, .TB$
  3545.  
  3546. Creates an edit control.  [HACKER'S GUIDE ALERT:>  First, make that a .Field$  It's always a string variable.  And it cannot be dimensioned.  For example,
  3547.  
  3548. TextBox 8, 50, 400, 12, .MyArray$(3)
  3549.  
  3550. will bomb out.  Why?  Lousy design decision.  You'll find some macros (including several of mine) with line after line after line assigning values to undimensioned variables just to handle this dumb requirement.  The Tech Ref is ridiculously confusing about TextBox.  All it does is display .Field$, let the user modify it, and return the modified results back to your macro.
  3551.  
  3552. In WinWord 1.0, .Field$ was "poured" into the defined area, starting in the upper left corner.  But in version 1.1, 1.10a, etc., .Field$ is "poured" into the defined area, centered from top to bottom.  Yecch.  Another "improvement" in 1.1: Newline and Paragraph marks do not force line feeds any more.  Really screwed up one of the early versions of Enveloper with this design decision........  The user cannot type in a Shift+Enter - or any other paragraph mark - so you cannot use TextBox for a lot of things.  I don't think Alt-0027 will come through either.  Check on other Alt-codes to see if they will work before you use TextBox in any situation that requires anything beyond ANSI Windows characters.  It's really too bad, too, because TextBox - if it were implemented properly - could be a very powerful command!
  3553.  
  3554. .Field$ is limited to 255 characters.  But that usually doesn't matter much, because the number of characters in .Field$ "count" against the dialog box max of 512.  That can give you runtime errors - Dialog Box Description Too Complex - if you aren't careful.  If you want an ampersand to show up you must double it.  I.e., &A will display as A   But &&A will display as &A
  3555.  
  3556. Generally you will want a dialog box's "cursor" to go to a TextBox first.  If you make a TextBox the first item in the UserDialog, the "cursor" will go there, and highlight any default text you may have inserted.]
  3557.  
  3558.  
  3559. :Time$()
  3560.  
  3561. Syntax: A$ = Time$() 
  3562.  
  3563. Returns the current time in the default format.
  3564.  
  3565. :ToggleFieldDisplay
  3566.  
  3567. Syntax:  ToggleFieldDisplay
  3568.  
  3569. Toggles the display between field codes and field results.
  3570.  
  3571. :UCase$()
  3572.  
  3573. Syntax: A$ = UCase$(A$) 
  3574.  
  3575. Returns A$ converted to uppercase.
  3576.  
  3577. :TraceMacro
  3578.  
  3579.   [HACKER'S GUIDE ALERT: >  Another undocumented WinWord command.]
  3580.  
  3581. :Underline
  3582.  
  3583. Syntax:  Underline [On]
  3584.  
  3585. Without the argument, toggles underlining for the entire selection. If On is nonzero, makes the entire selection underlined. If On is 0 (zero), removes underlining from the entire selection.
  3586.  
  3587. :Underline()
  3588.  
  3589. Syntax:  Num = Underline()
  3590.  
  3591. Returns 0 (zero) if none of the selection is underlined, 1 if all of the selection is underlined, or -1 if part of the selection is underlined or more than one kind of underlining is used.
  3592.  
  3593. :UnHang
  3594.  
  3595. Syntax:  UnHang
  3596.  
  3597. Reduces the amount of indent in a hanging indent.
  3598.  
  3599. :UnIndent
  3600.  
  3601. Syntax:  UnIndent
  3602.  
  3603. Removes the indent from the selected paragraphs. The first paragraph is aligned with the previous tab stop.
  3604.  
  3605. :UnLinkFields
  3606.  
  3607. Syntax:  UnLinkFields
  3608.  
  3609. Converts the selected fields to plain text and uses the last result.
  3610.  
  3611. :UnLockFields
  3612.  
  3613. Syntax:  UnLockFields
  3614.  
  3615. Unlocks fields in the current selection for updating.    [HACKER'S GUIDE ALERT: >  The Tech Ref  has a mighty cryptic description of UnLockFields.  Here's an example that may help.  If you insert a date field into your document, format and update it, you'll get the date.  Unfortunately, the next time you update fields for that document, the date will change.  To keep the date field from changing - in fact, to keep any field from being updated during the usual update fields operation - just stick your cursor anywhere inside the field, then issue UnLockFields.  (Equivalently, reformed WurdPerfect addicts can push Ctrl-Shift-F9.)  Once a field is "unlocked" it won't be updated any more.]
  3616.  
  3617. :UnSpike
  3618.  
  3619. Syntax:  UnSpike
  3620.  
  3621. Empties the Spike glossary and inserts all contents into the document at the 
  3622. selection.
  3623.  
  3624. :UpdateFields
  3625.  
  3626. Syntax:  UpdateFields
  3627.  
  3628. Updates the fields in the selection.
  3629.  
  3630. :UpdateSource
  3631.  
  3632. Syntax:  UpdateSource
  3633.  
  3634. Sends changes in linked Word documents back to their source. 
  3635.  
  3636. :UtilCalculate
  3637.  
  3638. Syntax:  UtilCalculate 
  3639.  
  3640. Equivalent to the Calculate command on the Utilities menu.  The selection is evaluated as a mathematical expression. The result of the evaluation is placed on the Clipboard.
  3641.  
  3642. :UtilCalculate()
  3643.  
  3644. Syntax:  Num = UtilCalculate([Expression$]) 
  3645.  
  3646. Evaluates Expression. With the argument, this function is equivalent to the = field.  Values in Expression can be table cell references. For more information on the = field, see Fields.  Without an expression, performs the same operation as the UtilCalculate statement, but returns the result rather than placing it on the Clipboard.    [HACKER'S GUIDE ALERT: >  Go to great lengths to make sure there are no paragraph marks in your selection, prior to running UtilCalculate.   Paragraph marks drive UtilCalculate crazy; a paragraph mark in front of a negative number may hang your system.]
  3647.  
  3648. :UtilCompareVersions
  3649.  
  3650. Syntax:  UtilCompareVersions Name$
  3651.  
  3652. Equivalent to the Compare Versions command on the Utilities menu. Compares the current document with the document specified by Name$. 
  3653.  
  3654. :UtilCustomize
  3655.  
  3656. Syntax:  UtilCustomize [AutoSave], [Units], [Pagination], [SummaryPrompt], [ReplaceSelection], [Name$], [Initials$], [ButtonFieldClicks]
  3657.  
  3658. Equivalent to the Customize command on the Utilities menu. The following table summarizes the arguments. Some arguments take measurements in points or numbers. Other arguments correspond to check boxes. 
  3659.  
  3660.    Argument              Description
  3661.    ----------------              ------------------
  3662.    AutoSave               Specifies automatic save frequency; can be 0 (Never), 1 (Low), 2 (Medium), or 3 (High)
  3663.    Units                      Units of measure used in the Ruler; can be 0 (inches), 1 (centimeters), 2 (points), or 3 (picas)
  3664.    Pagination             Corresponds to Background Pagination checkbox
  3665.    SummaryPrompt   Corresponds to Prompt For Summary Info check box
  3666.    ReplaceSelection  Corresponds to Typing Replaces Selection check box
  3667.    Name$                   Your name
  3668.    Initials$                 Your initials
  3669.    ButtonFieldClicks   1 if one mouse click activates a MACROBUTTON or GOTOBUTTON field; 2 if two clicks are required
  3670.  
  3671. :UtilGetSpelling
  3672.  
  3673. Syntax:  UtilGetSpelling FillArray$(), Word$, MainDic$, SuppDic$ 
  3674.  
  3675. Fills the string array FillArray$ with all available spellings for a word. If Word$ is supplied, that word is used. If it is not supplied, Word uses the word closest to the insertion point. The spellings for each definition are appended in the order they appear in the spelling checker. 
  3676.  
  3677. Sub MAIN
  3678.   Dim S$(10)
  3679.   UtilGetSpelling S$(), "color"
  3680.   For x = 1 To 10
  3681.      MsgBox S$(x)
  3682.   Next x
  3683. End Sub
  3684.  
  3685. :UtilGetSpelling()
  3686.  
  3687. Syntax:  Log = UtilGetSpelling(FillArray$(), Word$, MainDic$, SuppDic$) 
  3688.  
  3689. Fills the string array FillArray$ with all available spellings of a word. If Word$ is supplied, that word is used. If it is not supplied, Word uses the word closest to the insertion point. The spellings for each definition are appended in the order they appear in the spelling checker. Returns 0 (zero) if the word is spelled correctly. 
  3690.  
  3691. :UtilGetSynonyms
  3692.  
  3693. Syntax:  UtilGetSynonyms FillArray$(), [Word$]  
  3694.  
  3695. Fills the string array FillArray$ with all available synonyms for Word$. If Word$ is not supplied, the word nearest the selection is used. 
  3696.  
  3697. :UtilGetSynonyms()
  3698.  
  3699. Syntax:  Log = UtilGetSynonyms(FillArray$(), [Word$])  
  3700.  
  3701. Fills the string array FillArray$ with all available synonyms for Word$. If Word$ is not supplied, the word nearest the selection is used. Returns 0 (zero) if there are no synonyms available and returns -1 if one or more synonyms are available. 
  3702.  
  3703. :UtilHyphenate
  3704.  
  3705. Syntax:  UtilHyphenate [HyphenateCaps], [Confirm], [HotZone$] 
  3706.  
  3707. Equivalent to the Hyphenate command on the Utilities Menu. The following table summarizes the arguments. The arguments correspond to check boxes. 
  3708.  
  3709.    Argument              Description
  3710.    ---------------               -------------------
  3711.    HyphenateCaps   Corresponds to Hyphenate Caps check box
  3712.    Confirm                Corresponds to Confirm check box
  3713.    HotZone[$]           Measurement for hyphenation hot zone
  3714.  
  3715.   [HACKER'S GUIDE ALERT: >  For some unknown reason, UtilHyphenate leaves the document selected.  That can be very disconcerting to a novice.  Always do something like this:
  3716.  
  3717.    UtilHyphenate
  3718.    CharLeft
  3719.  
  3720. to de-select the document.]
  3721.  
  3722. :UtilRenumber 
  3723.  
  3724. Syntax:  UtilRenumber [NumParas], [Type], [Format$], [StartAt], [ShowAllLevels] 
  3725.  
  3726. Equivalent to the Renumber command on the Utilities menu. The following table summarizes the arguments. The arguments correspond to check boxes. 
  3727.  
  3728.    Argument            Description
  3729.    ----------------           --------------------
  3730.    NumParas          Specifies which paragraphs to renumber; can be 0 for all (default), 1 for numbered paragraphs only, or 2 for remove
  3731.    Type                   0 for automatic (default) or 1 for manual
  3732.    Format$              Numbering format; can be Legal, Outline, or Sequence
  3733.    StartAt                 Number to start paragraph numbering
  3734.    ShowAllLevels    Corresponds to Show All Levels check box
  3735.  
  3736. :UtilRepaginateNow
  3737.  
  3738. Syntax:  UtilRepaginateNow
  3739.  
  3740. Equivalent to the Repaginate Now command on the Utilities menu. Forces repagination of the entire document.
  3741.  
  3742. :UtilRevisionMarks 
  3743.  
  3744. Syntax:  UtilRevisionMarks [MarkRevisions], [RevisionBars], [NewText] 
  3745.  
  3746. Equivalent to the Revision Marks command on the Utilities menu. The following table summarizes the arguments. The arguments correspond to check boxes. 
  3747.  
  3748.    Argument             Description
  3749.    ----------------            ----------------------
  3750.    MarkRevisions   Corresponds to Mark Revisions check box
  3751.    RevisionBars     Specifies type of revision bar; can be 0 for none (default), 1 for outside, or 2 for inside
  3752.    NewText             Specifies what to mark new text with; can be 0 for none (default), 1 for bold, 2 for italic, 3 for underline, or 4 for double underline
  3753.  
  3754. The Search (for next text with revision marking) Accept Revisions or Undo Revisions command button name can be appended.
  3755.  
  3756. :UtilSort
  3757.  
  3758. Syntax:  UtilSort [Order], [Type], [Separator], [FieldNum[$]], [SortColumn], [CaseSensitive]
  3759.  
  3760. Equivalent to the Sort command on the Utilities menu.  The following table summarizes the arguments. 
  3761.  
  3762.    Argument              Description
  3763.    ---------------             --------------------
  3764.     Order                 Sorting order; can be 0 (ascending) or 1 (descending)
  3765.     Type                  Sort type; can be 0 (alphanumeric), 1 (numeric), or 2 (date)
  3766.     Separator          Can be 0 (comma) or 1 (tab)
  3767.     FieldNum[$]       Field number
  3768.     SortColumn        Corresponds to the Sort Column Only check box
  3769.    CaseSensitive    Corresponds to the Case Sensitive check box
  3770.  
  3771.   [HACKER'S GUIDE ALERT: >  Until Microsoft fixes UtilSort, it's virtually useless.  The problem is that there is only a fixed amount of memory that WinWord will use to sort.  If WinWord hits a situation where it needs more memory, it just dies with a "Not Enough Memory" message.  This is particularly galling when you have 7 Megs of free memory......(I had problems with this very same "quirk" in Word 4 and Word 5, as I recall.  Maybe some day they'll fix it?)]
  3772.  
  3773. :UtilSpelling 
  3774.  
  3775. Syntax:  UtilSpelling [Word$], [MainDic$], [SuppDic$], [IgnoreCaps], [AlwaysSuggest] 
  3776.  
  3777. Equivalent to the Spelling command on the Utilities menu.  The following table summarizes the arguments. The arguments correspond to check boxes. 
  3778.  
  3779.    Argument            Description
  3780.    ---------------            --------------------
  3781.      Word$                If Word$ is supplied, that word is used; if it is not supplied, Word searches forward from the insertion point for the next unmatched word
  3782.      MainDic$           The main dictionary, a two-letter key; for example, "AM" for LEX-AM.DLL
  3783.      SuppDic$           The supplemental dictionary
  3784.      IgnoreCaps        Corresponds to the Ignore ALL CAPS check box
  3785.      AlwaysSuggest  Corresponds to the Always Suggest check box
  3786.  
  3787. The Delete command button name can be appended to remove the word from the current supplemental dictionary.
  3788.  
  3789. :UtilSpellSelection
  3790.  
  3791. Syntax:  UtilSpellSelection
  3792.  
  3793. Checks the selection. If the selection is only part of a word, the selection is expanded to include the whole word. The default supplemental dictionary is used. 
  3794.  
  3795. :UtilThesaurus
  3796.  
  3797. Syntax:  UtilThesaurus 
  3798.  
  3799. Lists alternative words for the selection. Equivalent to the Thesaurus command on the Utilities menu. 
  3800.  
  3801. :Val()
  3802.  
  3803. Syntax:  Num = Val(A$) 
  3804.  
  3805. Returns the numeric value of A$.    [HACKER'S GUIDE ALERT: >  There's a typo.  
  3806. The last "Statement" should be:
  3807.  
  3808.     Print A$ + " dozen equals" + Str$(Total)      ]
  3809.  
  3810. :ViewAnnotations
  3811.  
  3812. Syntax:  ViewAnnotations [On] 
  3813.  
  3814. Turns on the annotations pane if On is nonzero, turns off the annotations pane is On is 0 (zero). Without the argument, toggles the annotations pane on and off. 
  3815.  
  3816. :ViewAnnotations()
  3817.  
  3818. Syntax: Log = ViewAnnotations() 
  3819.  
  3820. Returns -1 if annotations view mode is on, 0 (zero) if annotations view mode is off.
  3821.  
  3822. :ViewDraft
  3823.  
  3824. Syntax:  ViewDraft [On]
  3825.  
  3826. Turns on draft view mode if On is nonzero, turns off draft view mode if On is 0 (zero).  Without the argument, toggles draft view mode. If no window is open, the first window opened is opened in draft view. 
  3827.  
  3828. :ViewDraft()
  3829.  
  3830. Syntax:  Log = ViewDraft()
  3831.  
  3832. Returns -1 if draft view mode is on, 0 (zero) if draft view mode is off. 
  3833.  
  3834. :ViewFieldCodes
  3835.  
  3836. Syntax:  ViewFieldCodes [On]
  3837.  
  3838. Turns on field codes view mode if On is nonzero, turns off field codes view mode if On is 0 (zero).  Without the argument, toggles field codes view mode.  If no window is open, the first window opened shows field codes. 
  3839.  
  3840. :ViewFieldCodes()
  3841.  
  3842. Syntax:  Log = ViewFieldCodes()
  3843.  
  3844. Returns -1 if field codes view mode is on, 0 (zero) if field codes view mode is off. 
  3845.  
  3846. :ViewFootnotes
  3847.  
  3848. Syntax:  ViewFootnotes [On]
  3849.  
  3850. Turns on footnotes view mode if On is nonzero, turns off footnotes view mode if On is 0 (zero).  Without the argument, toggles footnotes view mode.  If no window is open, the first window opened is opened in footnotes view. 
  3851.  
  3852. :ViewFootnotes()
  3853.  
  3854. Syntax:  Log = ViewFootnotes()
  3855.  
  3856. Returns -1 if footnotes view mode is on, 0 (zero) if footnotes view mode is off.
  3857.  
  3858. :ViewFullMenus
  3859.  
  3860. Syntax:  ViewFullMenus
  3861.  
  3862. Turns on full menus.
  3863.  
  3864. :ViewMenus()
  3865.  
  3866. Syntax:  Num = ViewMenus()
  3867.  
  3868. Returns the menu state as follows:
  3869.  
  3870.    Return value      Menu state
  3871.    ---------------------     -----------------------------------
  3872.          0                  Normal short menus
  3873.          1                  Normal full menus
  3874.          2                  No document short menus
  3875.          3                  No document full menus
  3876.  
  3877. :ViewOutline
  3878.  
  3879. Syntax:  ViewOutline [On]
  3880.  
  3881. Turns on outline view mode if On is nonzero, turns off outline view mode if On is 0 (zero).  Without the argument, toggles outline view mode.  If no window is open, the first window opened is opened in outline view. 
  3882.  
  3883. :ViewOutline()
  3884.  
  3885. Syntax:  Log = ViewOutline()
  3886.  
  3887. Returns -1 if outline view mode is on, 0 (zero) if outline view mode is off.
  3888.  
  3889. :ViewPage
  3890.  
  3891. Syntax:  ViewPage [On]
  3892.  
  3893. Turns on page view mode if On is nonzero, turns off page view mode if On is 0 (zero).  Without the argument, toggles page view mode.  If no window is open, the first window opened is opened in page view. 
  3894.  
  3895. :ViewPage()
  3896.  
  3897. Syntax:  Log = ViewPage()
  3898.  
  3899. Returns -1 if page view mode is on, 0 (zero) if page view mode is off. 
  3900.  
  3901. :ViewPreferences
  3902.  
  3903. Syntax:  ViewPreferences [Tabs], [Spaces], [Paras], [Hyphens], [Hidden], [ShowAll], [DisplayAsPrinted], [Pictures], [TextBoundaries], [HScroll], [VScroll], [TableGridlines], [StyleAreaWidth[$]]
  3904.  
  3905. Equivalent to the Preferences command on the View menu.  The following table summarizes the arguments. The arguments correspond to check boxes. 
  3906.  
  3907.    Argument                Corresponds with
  3908.    ----------------                 -----------------------------
  3909.    Tabs                        Tabs check box
  3910.    Spaces                    Spaces check box
  3911.    Paras                       Paragraph Marks check box
  3912.    Hyphens                 Optional Hyphens check box
  3913.    Hidden                    Corresponds to the Hidden Text check box
  3914.    ShowAll                   Corresponds to the Show All check box
  3915.    DisplayAsPrinted    Display As Printed check box
  3916.    Pictures                   Pictures check box
  3917.    TextBoundaries      Text Boundaries check box
  3918.    HScroll                    Horizontal Scroll Bar check box
  3919.    VScroll                     Vertical Scroll Bar check box
  3920.    TableGridlines        Table Gridlines check box
  3921.    StyleAreaWidth[$]   Size occupied by style name area in the document window
  3922.  
  3923.   [HACKER'S GUIDE ALERT: >  When you turn on ViewSpaces - you're used to seeing those nice, little dots representing spaces, right?  Most of the time, that's exactly what you get.  Not so if you are using the Symbol of ZapfDingbat font.  A space-dot in Symbol comes out to be a big, ugly bullet.  A space-dot in ZapfDingbats comes up as a serif "2" in a solid circle.  They're both character #183.  Apparently, with View Spaces ON, WinWord captures character #32 (the space) and displays it as character #183.  That's OK with most fonts, but not very good in Symbol of ZapfDingbats - and Character 183 will show up as a ± in any screen font built on the Roman-8 Symbol Set.  Something similar happens to paragraph marks.]
  3924.  
  3925. :ViewRibbon
  3926.  
  3927. Syntax:  ViewRibbon [On]
  3928.  
  3929. Turns on the ribbon if On is nonzero, turns off the ribbon if On is 0 (zero).  Without the argument, toggles the ribbon.  If no window is open, the first window opened is opened with the ribbon. 
  3930.  
  3931. :ViewRibbon()
  3932.  
  3933. Syntax:  Log = ViewRibbon()
  3934.  
  3935. Returns -1 if the ribbon is on, 0 (zero) if the ribbon is off.
  3936.  
  3937. :ViewRuler
  3938.  
  3939. Syntax:  ViewRuler [On]
  3940.  
  3941. Turns on the ruler if On is nonzero, turns off the ruler if On is 0 (zero).  Without the argument, toggles the ruler.  If no window is open, the first window opened is opened with the ruler. 
  3942.  
  3943. :ViewRuler()
  3944.  
  3945. Syntax:  Log = ViewRuler()
  3946.  
  3947. Returns -1 if the ruler is on, 0 (zero) if the ruler is off.
  3948.  
  3949. :ViewShortMenus
  3950.  
  3951. Syntax:  ViewShortMenus
  3952.  
  3953. Turns on short menus if On is nonzero, turns off short menus if On is 0 (zero).  Without the argument, toggles short menus.  If no window is open, the first window opened is opened in short menus. 
  3954.  
  3955. :ViewStatusBar
  3956.  
  3957. Syntax:  ViewStatusBar [On]
  3958.  
  3959. Turns on the status bar if On is nonzero, turns off the status bar if On is 0 (zero).  Without the argument, toggles the status bar.  If no window is open, the first window opened is opened with the status bar. 
  3960.  
  3961. :ViewStatusBar()
  3962.  
  3963. Syntax:  Log = ViewStatusBar()
  3964.  
  3965. Returns -1 if the status bar is on, 0 (zero) if the status bar is off.
  3966.  
  3967. :VLine
  3968.  
  3969. Syntax:  VLine [Count]
  3970.  
  3971. Scrolls down vertically by Count lines. If Count is not specified, one line is the default.  A negative Count scrolls up.
  3972.  
  3973. :VPage
  3974.  
  3975. Syntax:  VPage [Count]
  3976.  
  3977. Scrolls down vertically by Count screens.  If Count is not specified, one screen is the default.  A negative Count scrolls up.
  3978.  
  3979. :VScroll
  3980.  
  3981. Syntax:  VScroll Percentage
  3982.  
  3983. Scrolls vertically the specified percentage of the document length.
  3984.  
  3985. :VScroll()
  3986.  
  3987. Syntax:  Num = VScroll()
  3988.  
  3989. Returns the current vertical scroll position as a percentage of the document's size.
  3990.  
  3991. :Wend
  3992.  
  3993. See "While"
  3994.  
  3995. :While...Wend
  3996.  
  3997. Syntax:     While Condition 
  3998.                       Statement(s)
  3999.                  Wend
  4000.  
  4001. Repeats the statements in the block while the Condition is True. If the Condition is initially False, the loop is never executed. 
  4002.  
  4003. :Window()
  4004.  
  4005. Syntax:  Num = Window()
  4006.  
  4007. Returns the number of the currently selected window. The number ranges from 1 to the number of open windows. The number corresponds to the number on the Window menu.
  4008.  
  4009. :Window1-Window9
  4010.  
  4011. Syntax:  Windowx
  4012.  
  4013. Selects Window x.  This number corresponds to the number on the Window menu.  If you select a nonexistent window, an error is generated. 
  4014.  
  4015. :WindowArrangeAll
  4016.  
  4017. Syntax:  WindowArrangeAll
  4018.  
  4019. Arranges all open windows so that windows do not overlap.
  4020.  
  4021. :WindowName$()
  4022.  
  4023. Syntax:  A$ = WindowName$(n) 
  4024.  
  4025. Returns the title of the nth open window.  The n corresponds to the number on the Window menu. If n is 0 (zero) or not supplied, the name of the current window is returned. 
  4026.  
  4027. :WindowNewWindow
  4028.  
  4029. Syntax:  WindowNewWindow
  4030.  
  4031. Equivalent to the New Window command on the Window menu. Creates a copy of the current window.
  4032.  
  4033. :WindowPane()
  4034.  
  4035. Syntax:  Num = WindowPane()
  4036.  
  4037. If the window isn't split or if the top pane of the current window is selected, returns 1. If the bottom pane is selected, returns 3.
  4038.  
  4039. :WordLeft
  4040.  
  4041. Syntax:  WordLeft [Repeat], [Select] 
  4042.  
  4043. Moves the insertion point left by Repeat words, selecting if Select is nonzero.
  4044.  
  4045. :WordLeft()
  4046.  
  4047. Syntax:  Log = WordLeft([Repeat], [Select]) 
  4048.  
  4049. Moves the selection left by Repeat words.  Returns 0 (zero) if the action cannot be performed.  For example, the function returns 0 if the insertion point is at the beginning of the document.
  4050.  
  4051. :WordRight
  4052.  
  4053. Syntax:  WordRight [Repeat], [Select] 
  4054.  
  4055. Moves the insertion point right by Repeat words, selecting if Select is nonzero.
  4056.  
  4057. :WordRight()
  4058.  
  4059. Syntax:  Log = WordRight([Repeat], [Select]) 
  4060.  
  4061. Moves the selection right by Repeat words.  Returns 0 (zero) if the action cannot be performed.
  4062.  
  4063. STATEMENT:
  4064.    While WordRight(,1)
  4065.    Wend
  4066. MEANING:
  4067. Selects one word at a time, until the end of the document is reached 
  4068.  
  4069. :WordUnderline
  4070.  
  4071. Syntax:  WordUnderline [On]
  4072.  
  4073. Without the argument, toggles word-only underlining for the entire selection.  If On is nonzero, makes the entire selection word-only underlining.  If On is 0 (zero), removes word-only underlining from the entire selection.
  4074.  
  4075. :WordUnderline()
  4076.  
  4077. Syntax:  Log = WordUnderline()
  4078.  
  4079. Returns 0 (zero) if none of the selection is word underlined; 1 if all of the selection is underlined; or -1 if part of the selection is word underlined or more than one kind of underlining is used.
  4080.  
  4081. :Write
  4082.  
  4083. Syntax:  Write [#]StreamNumber, Expressions
  4084.  
  4085. Writes the arguments to StreamNumber including delimiters so they can be read by the Read statement. 
  4086.  
  4087.