The information in this article applies to:
- Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b,
2.0c, 6.0, 6.0a, 6.0c
SYMPTOMS
If you create a macro in Microsoft Word for Windows select multiple
paragraphs and remove any shading in the selection, the macro does not
remove the shading unless the entire selection is shaded. If the
entire selection contains shading, the macro removes the shading
correctly; however, if only a part of the selection contains shading,
the macro does not remove the shading.
STATUS
Microsoft has confirmed this to be a problem in the versions of
Microsoft Word for Windows listed above. We are researching this
problem and will post more information here in the Microsoft Knowledge
Base as it becomes available.
MORE INFORMATION
Steps to Reproduce Problem
Example 1: Shading in Table Cells
- From the File menu, choose New, and choose the OK button.
- From the Tools menu, choose Macro.
- Type "UnShadeTable" (without the quotation marks) in the Macro Name
box, and choose the Edit button.
- In the macro-editing window, type the following macro:
Sub Main
TableSelectTable
FormatBorder .FromText = "", .ApplyTo = 3, .Shadow = 0, \
.TopBorder = 0, .LeftBorder = 0, .BottomBorder = 0, \
.RightBorder = 0, .HorizBorder = 0, .VertBorder = 0, \
.TopColor = 0, .LeftColor = 0, .BottomColor = 0, \
.RightColor = 0, .HorizColor = 0, .VertColor = 0, \
.Pattern = 0, .Foreground = 0, .Background = 0
End Sub
- From the File menu, choose Close. Choose the Yes button when
prompted to save changes to the macro.
- In the document, create a multi-column, multi-row table. (From the
Table menu, choose Insert Table; or, choose the Table button on the
tool bar.)
- Select several cells in the table. From the Format menu, choose
Border, select a border, then choose the Shading button. Select the
Custom option button, select an percentage from the Pattern box, and
choose the OK button twice.
- From the Tools menu, choose Macro, select UnShadeTable, and choose
the Run button.
Word removes the borders from the cells, but the shading remains.
Example 2: Shading in Paragraphs
- From the File menu, choose New, and choose the OK button.
- From the Tools menu, choose Macro.
- Type "UnShade" (without the quotation marks) in the Macro Name box,
and choose the Edit button.
- In the macro-editing window, type the following macro:
Sub Main
EditSelectAll
FormatBorder .FromText = "1 pt", .ApplyTo = 0, .Shadow = 0, \
.TopBorder = 0, .LeftBorder = 0, .BottomBorder = 0, \
.RightBorder = 0, .HorizBorder = 0, .VertBorder = 0, \
.TopColor = 0, .LeftColor = 0, .BottomColor = 0, \
.RightColor = 0, .HorizColor = 0, .VertColor = 0, \
.Pattern = 0, .Foreground = 0, .Background = 0
End Sub
- From the File menu, choose Close. Choose the Yes button when
prompted to save changes to the macro.
- In the document, type four paragraphs, and apply different amounts
of shading to each paragraph. (From the Format menu, choose Border,
then choose the Shading button to access the Shading dialog box.)
- From the Tools menu, choose Macro, select UnShade, and choose the
Run button.
The macro runs, but the paragraph shading remains.
REFERENCES
"Microsoft Word for Windows User's Guide," version 2.0, page 377-379,
764-765
Kbcategory: kbusage kbmacro
KBSubcategory: kbtable
|