InlineShapes.AddPicture 方法 (Word)InlineShapes.AddPicture method (Word)

在文档中添加一幅图片。Adds a picture to a document. 返回一个表示该图片的 InlineShape 对象。Returns an InlineShape object that represents the picture.

语法Syntax

expressionexpression. AddPicture( _FileName_ , _LinkToFile_ , _SaveWithDocument_ , _Range_ )

expression:必需。expression Required. 表示“InlineShapes”集合的变量。A variable that represents an 'InlineShapes' collection.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
FileNameFileName 必需Required StringString 图片的路径和文件名。The path and file name of the picture.
LinkToFileLinkToFile 可选Optional VariantVariant 要将图片链接到创建它的文件。True to link the picture to the file from which it was created. False 使图片文件的独立副本。False to make the picture an independent copy of the file. 默认值为 FalseThe default value is False.
SaveWithDocumentSaveWithDocument 可选Optional VariantVariant 要随文档一起保存的链接的图片。True to save the linked picture with the document. 默认值为 FalseThe default value is False.
RangeRange 可选Optional VariantVariant 图片置于文本中的位置。The location where the picture will be placed in the text. 如果该区域未折叠,那么图片将覆盖此区域,否则插入图片。If the range isn't collapsed, the picture replaces the range; otherwise, the picture is inserted. 如果省略此参数,则自动放置图片。If this argument is omitted, the picture is placed automatically.

另请参阅See also

InlineShapes 集合对象InlineShapes Collection 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.