InlineShapes 对象 (Word)InlineShapes object (Word)

InlineShape对象的集合, 这些对象代表文档、区域或所选内容中的所有内嵌形状。A collection of InlineShape objects that represent all the inline shapes in a document, range, or selection.

备注Remarks

使用InlineShapes属性返回InlineShapes集合。Use the InlineShapes property to return the InlineShapes collection. 下面的示例将活动文档中的每个内嵌形状转换为 Shape 对象。The following example converts each inline shape in the active document to a Shape object.

For Each iShape In ActiveDocument.InlineShapes 
 iShape.ConvertToShape 
Next iShape

使用new方法创建新图片作为内嵌形状。Use the New method to create a new picture as an inline shape. 您可以使用 AddPictureAddOLEObject 若要添加图片或 OLE 对象并将其链接到源代码文件的方法。You can use the AddPicture and AddOLEObject methods to add pictures or OLE objects and link them to a source file. 使用 AddOLEControl 要将 ActiveX 控件添加方法。Use the AddOLEControl method to add an ActiveX control.

Shape 对象定位到文本区域,但可以自由浮动,可放置在页面上的任何位置。Shape objects are anchored to a range of text but are free-floating and can be positioned anywhere on the page. 您可以使用 ConvertToInlineShape 方法和 ConvertToShape 若要将形状从一种类型转换为其他的方法。You can use the ConvertToInlineShape method and the ConvertToShape method to convert shapes from one type to the other. 只能将图片、OLE 对象和 ActiveX 控件转换为内嵌形状。You can convert only pictures, OLE objects, and ActiveX controls to inline shapes.

一个文档中,以上集合的 Count 属性返回正文部分的项目数。The Count property for this collection in a document returns the number of items in the main story only. 要统计其他部分中的个数,请使用带有 Range 对象的集合。To count items in other stories use the collection with the Range object.

打开一篇使用早期版本的 Word 创建的文档时,图片将转换为内嵌形状。When you open a document created in an earlier version of Word, pictures are converted to inline shapes.

另请参阅See also

Word 对象模型参考Word Object Model Reference

支持和反馈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.