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 = System::MakeObject<Aspose::Words::Document>();
System::SharedPtr<Aspose::Words::TabStopCollection> tabStops = doc->get_FirstSection()->get_Body()->get_Paragraphs()->idx_get(0)->get_ParagraphFormat()->get_TabStops();

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

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

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

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

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

See Also