I have tried this solution. It is not working for me.
Current version : 22.3.0
We have license for Aspose.Total for .NET
Whenever we produce any Word docx file we get a file which which we generally open in
Microsoft Word for Microsoft 365
We always get the Compatibility mode strip on the top:.
This is our current code. Please suggest code to fixt this:
CODE:
Document doc = new Document();
doc.CompatibilityOptions.OptimizeFor(Aspose.Words.Settings.MsWordVersion.Word2019);
//Begin Update doc sectio
//End Update doc section
using var ms = new MemoryStream();
var saveFormat = reportRequest.OutputFormat switch
{
ProfileReportFormat.PDF => SaveFormat.Pdf,
_ => SaveFormat.Docx,
};
///used to solve compatibility mode issues
if (saveFormat == SaveFormat.Docx)
Aspose.Words.Saving.OoxmlSaveOptions saveOptions = new Aspose.Words.Saving.OoxmlSaveOptions
{
Compliance = Aspose.Words.Saving.OoxmlCompliance.Iso29500_2008_Transitional,
SaveFormat = saveFormat
};
doc.Save(ms, saveOptions);