remove_by_index method
remove_by_index(index)
Removes a tab stop at the specified index from the collection.
def remove_by_index(self, index: int):
...
Parameter | Type | Description |
---|---|---|
index | int | An index into the collection of tab stops. |
Examples
Shows how to select a tab stop in a document by its index and remove it.
doc = aw.Document()
tab_stops = doc.first_section.body.paragraphs[0].paragraph_format.tab_stops
tab_stops.add(position=aw.ConvertUtil.millimeter_to_point(30), alignment=aw.TabAlignment.LEFT, leader=aw.TabLeader.DASHES)
tab_stops.add(position=aw.ConvertUtil.millimeter_to_point(60), alignment=aw.TabAlignment.LEFT, leader=aw.TabLeader.DASHES)
self.assertEqual(2, tab_stops.count)
# Remove the first tab stop.
tab_stops.remove_by_index(0)
self.assertEqual(1, tab_stops.count)
doc.save(file_name=ARTIFACTS_DIR + 'TabStopCollection.RemoveByIndex.docx')
See Also
- module aspose.words
- class TabStopCollection