OoxmlSaveOptionsSaveFormat Property

Specifies the format in which the document will be saved if this save options object is used. Can be Docx, Docm, Dotx, Dotm or FlatOpc.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public override SaveFormat SaveFormat { get; set; }

Property Value

Type: SaveFormat
Examples
Shows conversion VML shapes to DML using ISO/IEC 29500:2008 Strict compliance level.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Set Word2003 version for document, for inserting image as VML shape
doc.CompatibilityOptions.OptimizeFor(MsWordVersion.Word2003);

builder.InsertImage(ImageDir + "Transparent background logo.png");

// Loop through all single shapes inside document.
foreach (Shape shape in doc.GetChildNodes(NodeType.Shape, true).OfType<Shape>())
{
    Console.WriteLine(shape.MarkupLanguage);
}

// Iso29500_2008 does not allow VML shapes
// You need to use OoxmlCompliance.Iso29500_2008_Strict for converting VML to DML shapes
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions
{
    Compliance = OoxmlCompliance.Iso29500_2008_Strict,
    SaveFormat = SaveFormat.Docx
};

doc.Save(ArtifactsDir + "OoxmlSaveOptions.Iso29500Strict.docx", saveOptions);
See Also