Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Description

Excerpt

This class is used to represent an inline image in a Word document. The types of images that Word supports are jpg, png, bmp, and gif. Inline images are part of the InlineElement objects of an Element.

Signature
C#
C#
 public sealed class InlineImage : Element
Signature
vb.net
vb.net
Public NotInheritable Class InlineImage
		Inherits Element
Remarks

To create a new inline image, use the insert methods for inline images from the Element or Position class.

Example

The following sample demonstrates creating a inline image at the end of a new document and retrieving the first inline image of an existing document.

Code Block
csharp
csharp
titleC#

          //--- Insert a inline image at the end of a new document
          WordApplication app = new WordApplication();
          Document doc = app.Create();
          InlineImage image = doc.InsertImageAfter(@"C:\sample.jpg");

          //--- Get the first inline image of an existing document
          WordApplication app = new WordApplication();
          Document doc = app.Open(@"C:\sample.doc");
          InlineImage firstImage =
               (InlineImage)doc.GetElements(Element.Type.InlineImage)[0];
        
Code Block
vb.net
vb.net
titlevb.net

          '--- Insert an inline image at the end of a new document
          Dim app As New WordApplication()
          Dim doc As Document = app.Create()
          Dim image As InlineImage = doc.InsertImageAfter("C:\sample.jpg")

          '--- Get the first inline image of an existing document
          Dim app As New WordApplication()
          Dim doc As Document = app.Open("C:\sample.doc")
          Dim firstImage As InlineImage = _
               doc.GetElements(Element.Type.InlineImage)(0)
        
Properties

Name

Description

Height

Excerpt Include
InlineImage.Height
InlineImage.Height
nopaneltrue

Image

Excerpt Include
InlineImage.Image
InlineImage.Image
nopaneltrue

ImageFormat

Excerpt Include
InlineImage.ImageFormat
InlineImage.ImageFormat
nopaneltrue

Width

Excerpt Include
InlineImage.Width
InlineImage.Width
nopaneltrue
Methods

Name

Description

GetImage(InlineImage.Format)

Excerpt Include
InlineImage.GetImage(InlineImage.Format)
InlineImage.GetImage(InlineImage.Format)
nopaneltrue
Classes

Name

Description

Format

Excerpt Include
InlineImage.Format
InlineImage.Format
nopaneltrue