Aspose::Words::TabStopCollection::RemoveByIndex method

TabStopCollection::RemoveByIndex method

Removes a tab stop at the specified index from the collection.

void Aspose::Words::TabStopCollection::RemoveByIndex(int32_t index)
ParameterTypeDescription
indexint32_tAn index into the collection of tab stops.

Examples

Shows how to select a tab stop in a document by its index and remove it.

auto doc = MakeObject<Document>();
SharedPtr<TabStopCollection> tabStops = doc->get_FirstSection()->get_Body()->get_Paragraphs()->idx_get(0)->get_ParagraphFormat()->get_TabStops();

tabStops->Add(ConvertUtil::MillimeterToPoint(30), TabAlignment::Left, TabLeader::Dashes);
tabStops->Add(ConvertUtil::MillimeterToPoint(60), TabAlignment::Left, TabLeader::Dashes);

ASSERT_EQ(2, tabStops->get_Count());

// Remove the first tab stop.
tabStops->RemoveByIndex(0);

ASSERT_EQ(1, tabStops->get_Count());

doc->Save(ArtifactsDir + u"TabStopCollection.RemoveByIndex.docx");

See Also