Aspose::Words::FileFormatUtil::SaveFormatToLoadFormat method

FileFormatUtil::SaveFormatToLoadFormat method

Converts a SaveFormat value to a LoadFormat value if possible.

static Aspose::Words::LoadFormat Aspose::Words::FileFormatUtil::SaveFormatToLoadFormat(Aspose::Words::SaveFormat saveFormat)

Examples

Shows how to convert a save format to its corresponding load format.

ASSERT_EQ(LoadFormat::Html, FileFormatUtil::SaveFormatToLoadFormat(SaveFormat::Html));

// Some file types can have documents saved to, but not loaded from using Aspose.Words.
// If we attempt to convert a save format of such a type to a load format, an exception will be thrown.
ASSERT_THROW(FileFormatUtil::SaveFormatToLoadFormat(SaveFormat::Jpeg), System::ArgumentException);

See Also