get_position_by_index method

get_position_by_index(index)

Gets the position (in points) of the tab stop at the specified index.

def get_position_by_index(self, index: int):
    ...
ParameterTypeDescription
indexintAn index into the collection of tab stops.

Returns

The position of the tab stop.

Examples

Shows how to find a tab, stop by its index and verify its position.

doc = aw.Document()
tab_stops = doc.first_section.body.paragraphs[0].paragraph_format.tab_stops

tab_stops.add(aw.ConvertUtil.millimeter_to_point(30), aw.TabAlignment.LEFT, aw.TabLeader.DASHES)
tab_stops.add(aw.ConvertUtil.millimeter_to_point(60), aw.TabAlignment.LEFT, aw.TabLeader.DASHES)

# Verify the position of the second tab stop in the collection.
self.assertAlmostEqual(aw.ConvertUtil.millimeter_to_point(60), tab_stops.get_position_by_index(1), delta=0.1)

See Also