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

粘贴选定的表格单元格,并为其设置指定的格式。Pastes the selected table cells and formats them as specified.

语法Syntax

expressionexpression. PasteAndFormat( _Type_ )

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

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
TypeType 必需Required WdRecoveryTypeWdRecoveryType 粘贴所选的表格单元格时使用的格式类型。The type of formatting to use when pasting the selected table cells.

示例Example

以下示例将所选 Microsoft Excel 图表粘贴为图片。This example pastes a selected Microsoft Excel chart as a picture. 该示例假定"剪贴板"包含 Excel 图表。This example assumes that the Clipboard contains an Excel chart.

Sub PasteChart() 
 Selection.PasteAndFormat Type:=wdChartPicture 
End Sub

另请参阅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.