public void AddEx() { //ExStart //ExFor:TabStopCollection.Add(TabStop) //ExFor:TabStopCollection.Add(Double, TabAlignment, TabLeader) //ExSummary:Shows how to create tab stops and add them to a document. Aspose.Words.Document doc = new Aspose.Words.Document(ExDir + "Document.doc"); Aspose.Words.Paragraph paragraph = (Aspose.Words.Paragraph)doc.GetChild(Aspose.Words.NodeType.Paragraph, 0, true); // Create a TabStop object and add it to the document. Aspose.Words.TabStop tabStop = new Aspose.Words.TabStop(Aspose.Words.ConvertUtil.InchToPoint(3), Aspose.Words.TabAlignment.Left, Aspose.Words.TabLeader.Dashes); paragraph.ParagraphFormat.TabStops.Add(tabStop); // Add a tab stop without explicitly creating new TabStop objects. paragraph.ParagraphFormat.TabStops.Add(Aspose.Words.ConvertUtil.MillimeterToPoint(100), Aspose.Words.TabAlignment.Left, Aspose.Words.TabLeader.Dashes); // Add tab stops at 5 cm to all paragraphs. foreach (Aspose.Words.Paragraph para in doc.GetChildNodes(Aspose.Words.NodeType.Paragraph, true)) { para.ParagraphFormat.TabStops.Add(Aspose.Words.ConvertUtil.MillimeterToPoint(50), Aspose.Words.TabAlignment.Left, Aspose.Words.TabLeader.Dashes); } doc.Save(ExDir + "Document.AddedTabStops Out.doc"); //ExEnd }
public void AddEx() { //ExStart //ExFor:TabStopCollection.Add(TabStop) //ExFor:TabStopCollection.Add(Double, TabAlignment, TabLeader) //ExSummary:Shows how to create and add tabStop objects to a document. Aspose.Words.Document doc = new Aspose.Words.Document(ExDir + "Document.doc"); Aspose.Words.Paragraph paragraph = (Aspose.Words.Paragraph)doc.GetChild(Aspose.Words.NodeType.Paragraph, 0, true); // Create a TabStop object and add it into the document Aspose.Words.TabStop tabStop = new Aspose.Words.TabStop(84.99, Aspose.Words.TabAlignment.Left, Aspose.Words.TabLeader.Dashes); paragraph.ParagraphFormat.TabStops.Add(tabStop); // Add a TabStop without explicitly initializing paragraph.ParagraphFormat.TabStops.Add(169.98, Aspose.Words.TabAlignment.Left, Aspose.Words.TabLeader.Dashes); doc.Save(ExDir + "Document.AddedTabStops Out.doc"); //ExEnd }