DocumentBuilderCurrentStory Property

Gets the story that is currently selected in this DocumentBuilder.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.5
Syntax
public Story CurrentStory { get; }

Property Value

Type: Story
Examples
Shows how to work with a document builder's current story.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// A Story is a type of node that have child Paragraph nodes, such as a Body,
// which would usually be a parent node to a DocumentBuilder's current paragraph
Assert.AreEqual(builder.CurrentStory, doc.FirstSection.Body);
Assert.AreEqual(builder.CurrentStory, builder.CurrentParagraph.ParentNode);
Assert.AreEqual(StoryType.MainText, builder.CurrentStory.StoryType);

builder.CurrentStory.AppendParagraph("Text added to current Story.");

// A Story can contain tables too
Table table = builder.StartTable();
builder.InsertCell();
builder.Write("Row 1 cell 1");
builder.InsertCell();
builder.Write("Row 1 cell 2");
builder.EndTable();

// The table we just made is automatically placed in the story
Assert.IsTrue(builder.CurrentStory.Tables.Contains(table));
See Also