InsertColumns 方法 (Word)Selection.InsertColumns method (Word)

在选定内容的左侧插入新列。Inserts columns to the left of the column that contains the selection.

语法Syntax

expression.expression. InsertColumns

_表达式_是必需的。expression Required. 表示 Selection 对象的变量。A variable that represents a Selection object.

备注Remarks

插入的列数与选定列数相等。The number of columns inserted is equal to the number of columns selected. 您还可以使用columns对象的**Add** 方法插入列。You can also insert columns by using the Add method of the Columns object.

如果选定内容不在表格中,则会导致出错。If the selection isn't in a table, an error occurs.

示例Example

本示例在所选内容的左侧插入新列。This example inserts new columns to the left of the column that contains the selection. 插入的列数与选定列数相等。The number of columns inserted is equal to the number of columns selected.

If Selection.Information(wdWithInTable) = True Then 
 With Selection 
 .InsertColumns 
 .Shading.Texture = wdTexture10Percent 
 End With 
End If

另请参阅See also

Selection 对象Selection Object

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.