InlineShapes 接口


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

public interface class InlineShapes : System::Collections::IEnumerable
public interface InlineShapes : System.Collections.IEnumerable
type InlineShapes = interface
    interface IEnumerable
Public Interface InlineShapes
Implements IEnumerable


使用、或对象的InlineShapes属性 _Document 返回一个 Range Selection InlineShapes 集合。Use the InlineShapes property of a _Document, Range, or Selection object to return an InlineShapes collection.

使用 New(Range) 方法将新图片创建为内嵌形状。Use the New(Range) method to create a new picture as an inline shape. 您可以使用 AddPicture(String, Object, Object, Object)AddOLEObject(Object, Object, Object, Object, Object, Object, Object, Object) 方法来添加图片或 OLE 对象,并将它们链接到源文件。You can use the AddPicture(String, Object, Object, Object) and AddOLEObject(Object, Object, Object, Object, Object, Object, Object, Object) methods to add pictures or OLE objects and link them to a source file. 使用 AddOLEControl(Object, Object) 方法添加 ActiveX 控件。Use the AddOLEControl(Object, Object) 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. 若要统计其他部分中的项目数,请使用带有该对象的集合 RangeTo count items in other stories use the collection with the Range object.

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



返回一个 Application 代表 Microsoft Word 应用程序的对象。Returns a Application object that represents the Microsoft Word application.


返回指定集合中的项目数。Returns the number of items in the specified collection.


返回一个 32 位整数,它指示在其中创建指定的对象的应用程序。Returns a 32-bit integer that indicates the application in which the specified object was created.


返回集合中的单个对象。Returns an individual object in a collection.


返回一个对象,代表指定对象的父对象。Returns an object that represents the parent object of the specified object.


AddChart(XlChartType, Object)

此对象、成员或枚举已被弃用并且不适合在您的代码中使用。This object, member, or enumeration is deprecated and is not intended to be used in your code.

AddChart2(Int32, XlChartType, Object, Object)

向文档添加图表。Adds a chart to the document. 返回一个 InlineShape 对象,该对象表示图表并将其添加到指定的集合。Returns an InlineShape object that represents the chart and adds it to the specified collection.

AddHorizontalLine(String, Object)

向当前文档添加一条基于图像文件的横线。Adds a horizontal line based on an image file to the current document.


向当前文档添加一条横线。Adds a horizontal line to the current document.

AddOLEControl(Object, Object)

创建一个 ActiveX 控件(以前称为 OLE 控件)。Creates an ActiveX control (formerly known as an OLE control).

AddOLEObject(Object, Object, Object, Object, Object, Object, Object, Object)

创建一个 OLE 对象。Creates an OLE object.

AddPicture(String, Object, Object, Object)

在文档中添加一幅图片。Adds a picture to a document.

AddPictureBullet(String, Object)

向当前文档添加一个基于图像文件的图片项目符号。Adds a picture bullet based on an image file to the current document.

AddSmartArt(SmartArtLayout, Object)

将 SmartArt 图形作为内嵌形状插入活动文档。Inserts a SmartArt graphic as an inline shape into the active document.

AddWebVideo(String, Object, Object, Object, Object, Object)

向文档中添加新的 web 视频。Adds a new web video to the document.


插入一个空白的1英寸方形的 Microsoft Word picture 对象,由边框包围。Inserts an empty, 1-inch-square Microsoft Word picture object surrounded by a border.