CurrentStory
Contents
[
Hide
]DocumentBuilder.CurrentStory property
Gets the story that is currently selected in this DocumentBuilder
.
public Story CurrentStory { get; }
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 has child Paragraph nodes, such as a Body.
Assert.That(doc.FirstSection.Body, Is.EqualTo(builder.CurrentStory));
Assert.That(builder.CurrentParagraph.ParentNode, Is.EqualTo(builder.CurrentStory));
Assert.That(builder.CurrentStory.StoryType, Is.EqualTo(StoryType.MainText));
builder.CurrentStory.AppendParagraph("Text added to current Story.");
// A Story can also contain tables.
Table table = builder.StartTable();
builder.InsertCell();
builder.Write("Row 1, cell 1");
builder.InsertCell();
builder.Write("Row 1, cell 2");
builder.EndTable();
Assert.That(builder.CurrentStory.Tables.Contains(table), Is.True);
See Also
- class Story
- class DocumentBuilder
- namespace Aspose.Words
- assembly Aspose.Words