Skip to content

Commit 96d1969

Browse files
committed
Merge pull request #62 from asposewords/romans91-new-examples
Added GetPositionByIndex to ExTabStop.cs
2 parents fc76d31 + add9123 commit 96d1969

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

QA Tests/AW Tests/Examples/Tab/ExTabStopCollection.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,21 @@ public void RemoveByIndexEx()
7070
doc.Save(ExDir + "Document.RemovedTabStopsByIndex Out.doc");
7171
//ExEnd
7272
}
73+
74+
[Test]
75+
public void GetPositionByIndexEx()
76+
{
77+
//ExStart
78+
//ExFor:TabStopCollection.GetPositionByIndex
79+
//ExSummary:Shows how to find a tab by it's index and get its position.
80+
Aspose.Words.Document doc = new Aspose.Words.Document(ExDir + "Document.doc");
81+
Aspose.Words.Paragraph paragraph = (Aspose.Words.Paragraph)doc.GetChild(Aspose.Words.NodeType.Paragraph, 0, true);
82+
83+
paragraph.ParagraphFormat.TabStops.Add(85, Aspose.Words.TabAlignment.Left, Aspose.Words.TabLeader.Dashes);
84+
paragraph.ParagraphFormat.TabStops.Add(170, Aspose.Words.TabAlignment.Left, Aspose.Words.TabLeader.Dashes);
85+
86+
Console.WriteLine(paragraph.ParagraphFormat.TabStops.GetPositionByIndex(1)); // 170
87+
//ExEnd
88+
}
7389
}
7490
}

0 commit comments

Comments
 (0)