WD: WordBasic Examples: FormatMultilevel

ID: Q105985


The information in this article applies to:
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows 95, version 7.0


SUMMARY

This article contains an example that demonstrates the use of the following WordBasic statement or function:

FormatMultilevel
This article supplements the information in online Help. To open this Help topic, choose Contents from the Help menu and then choose the "Programming with Microsoft Word" topic.


MORE INFORMATION

WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this macro code "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

FormatMultilevel

Syntax:

   FormatMultilevel [.Points = number] [, .Color = number] [, \ 
   .Before = text] [, .Type = number] [, .After = text] [, \ 
   .StartAt = number] [, .Include = number] [, .Alignment = number] \ 
   [, .Indent = number or text] [, .Space = number or text] \ 
   [, .Hang = number] [, .Level = number] [, .Font = text] \ 
   [, .Strikethrough = number] [, .Bold = number] [, .Italic \ 
   = number] [, .Underline = number] 
Example:

The following macro changes the format of a selected level of a multilevel list. The multilevel list should be selected before the macro is run.

   Sub MAIN
      Begin Dialog UserDialog 254, 144, "Microsoft Word"
         OKButton 161, 92, 88, 21
         CancelButton 163, 118, 88, 21
         Text 4, 6, 163, 13, "Format Selected Text", .Text1
         Text 4, 77, 109, 13, "Apply to Level", .Text2
         OptionGroup  .Type
            OptionButton 21, 21, 148, 16, "1, 2, 3...", .OptionButton1
            OptionButton 21, 39, 156, 16, "I, II, III...", .OptionButton2
            OptionButton 21, 57, 147, 16, "A, B, C...", .OptionButton3
         OptionGroup  .Level
            OptionButton 21, 90, 60, 16, "One", .OptionButton4
            OptionButton 21, 107, 60, 16, "Two", .OptionButton5
            OptionButton 21, 123, 60, 16, "Three", .OptionButton6
      End Dialog
      Dim dlg As UserDialog
      GetCurValues dlg
      n = Dialog(dlg)
      If n = 0 Then Goto bye
      Select Case dlg.Type
         Case 0
            Type = 0
         Case 1
            Type = 1
         Case 2
            Type = 3
      End Select
      Select Case dlg.Level
         Case 0
            Level = 1
         Case 1
            Level = 2
         Case 2
            Level = 3
      End Select
      FormatMultilevel .Level = Level, .Type = Type, .Hang = 1
      FormatMultilevel
   bye:
   End Sub 

Additional query words:

Keywords : wordnt kbmacroexample ntword word6 word7 word95 word
Version : WINDOWS:6.0,6.0a,6.0c,7.0
Platform : WINDOWS
Issue type : kbinfo


Last Reviewed: December 23, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.