DocumentBase.InlineShapes Property
Gets an InlineShapes collection that represents all the InlineShape objects in the document.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
Syntax
'Declaration
Public ReadOnly Property InlineShapes As InlineShapes
Get
public InlineShapes InlineShapes { get; }
Property Value
Type: Microsoft.Office.Interop.Word.InlineShapes
An InlineShapes collection that represents all the InlineShape objects in the document.
Examples
The following code example adds an inline shape (a horizontal line) to the document and then shows a message box displaying the number of inline shapes. To use this example, run it from the ThisDocument class in a document-level project.
Private Sub DocumentInlineShapes()
Dim myRange As Object = Me.Paragraphs(1).Range
Me.InlineShapes.AddHorizontalLineStandard(myRange)
MessageBox.Show("Total inline shapes: " & Me.InlineShapes.Count.ToString())
End Sub
private void DocumentInlineShapes()
{
object myRange = this.Paragraphs[1].Range;
this.InlineShapes.AddHorizontalLineStandard(ref myRange);
MessageBox.Show("Total inline shapes: " +
this.InlineShapes.Count.ToString());
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.