DocumentBuilderInsertNode Method
Inserts a text level node inside the current paragraph before the cursor.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.12
Syntax
public void InsertNode(
	Node node
)

Parameters

node
Type: Aspose.WordsNode
Examples
Shows how to insert a linked image into a document.
DocumentBuilder builder = new DocumentBuilder();

string imageFileName = MyDir + "Images/Hammer.wmf";

builder.Write("Image linked, not stored in the document: ");

Shape linkedOnly = new Shape(builder.Document, ShapeType.Image);
linkedOnly.WrapType = WrapType.Inline;
linkedOnly.ImageData.SourceFullName = imageFileName;

builder.InsertNode(linkedOnly);
builder.Writeln();

builder.Write("Image linked and stored in the document: ");

Shape linkedAndStored = new Shape(builder.Document, ShapeType.Image);
linkedAndStored.WrapType = WrapType.Inline;
linkedAndStored.ImageData.SourceFullName = imageFileName;
linkedAndStored.ImageData.SetImage(imageFileName);

builder.InsertNode(linkedAndStored);
builder.Writeln();

builder.Write("Image stored in the document, but not linked: ");

Shape stored = new Shape(builder.Document, ShapeType.Image);
stored.WrapType = WrapType.Inline;
stored.ImageData.SetImage(imageFileName);

builder.InsertNode(stored);
builder.Writeln();

builder.Document.Save(ArtifactsDir + "Image.CreateLinkedImage.doc");
See Also