WordBasic Examples: FormatMultilevelLast reviewed: July 30, 1997Article ID: Q105985 |
The information in this article applies to:
SUMMARYThis article contains an example that demonstrates the use of the following WordBasic statement or function:
FormatMultilevelThis 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
SyntaxFormatMultilevel [.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]
ExampleThe 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 SubKbcategory: kbusage kbmacro KBSubcategory: kbmacroexample |
Additional query words: 6.0 winword word6 6.0a 6.0c 7.0 word95
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |