Aspose::Words::WarningInfoCollection::idx_get method

WarningInfoCollection::idx_get method

Gets an item at the specified index.

System::SharedPtr<Aspose::Words::WarningInfo> Aspose::Words::WarningInfoCollection::idx_get(int32_t index)
ParameterTypeDescription
indexint32_tZero-based index of the item.

Examples

Shows how to get warnings about unsupported formats.

auto warnings = System::MakeObject<Aspose::Words::WarningInfoCollection>();
auto loadOptions = System::MakeObject<Aspose::Words::Loading::LoadOptions>();
loadOptions->set_WarningCallback(warnings);
auto doc = System::MakeObject<Aspose::Words::Document>(get_MyDir() + u"FB2 document.fb2", loadOptions);

ASSERT_EQ(warnings->idx_get(0)->get_Description(), (u"The original file load format is FB2, which is not supported by Aspose.Words. The file is loaded as an XML document."));
ASSERT_EQ(warnings->get_Count(), 1);

See Also