WordBasic Examples: FormatMultilevel

Last reviewed: July 30, 1997
Article 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.

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 = 1, .Type = 3, .Hang = 1
   FormatMultilevel
bye:
End Sub

Kbcategory: kbusage kbmacro KBSubcategory: kbmacroexample


Additional query words: 6.0 winword word6 6.0a 6.0c 7.0 word95
word7

Keywords : kbmacroexample
Version : 6.0 6.0a 6.0c 7.0
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.