Word 2016 loading very slow and freezing

Hello Team,

I am generating documents using html, the generated documents were opening very slow(sometimes forever) on word 2016 and also freezing while editing or scrolling. However they open and work fine on Word 2010.

attached the sample code i am using.

i am using aspose.words 17.2

AsposeHtmlToWord Share.zip (25.2 KB)

Thanks,
Lalitya

@lalityay

Thanks for your inquiry. Please use the HtmlLoadOptions.WebRequestTimeout property as shown below to avoid this issue. This property is used to set the number of milliseconds to wait before the web request times out. Hope this helps you.

Aspose.Words.HtmlLoadOptions loadOptions = new Aspose.Words.HtmlLoadOptions();
loadOptions.WebRequestTimeout = 1000;
Document theDoc = new Document(MyDir + "input.html", loadOptions);

Thanks @tahir.manzoor , setting the below option made it faster while opening in Word2016.

            OoxmlSaveOptions options = new OoxmlSaveOptions(SaveFormat.Docx);
            options.Compliance = OoxmlCompliance.Iso29500_2008_Strict;
            theDoc.Save(location, options);

@lalityay

Thanks for your inquiry. Yes, your understanding is correct. You may also use CompatibilityOptions.OptimizeFor method to optimize the document contents to MS Word 2016.

theDoc.CompatibilityOptions.OptimizeFor(MsWordVersion.Word2016);

Hi @tahir.manzoor

the above issue is working fine now. however if the docx file is downloaded from web-app then it is getting blocked. Word 2013 and 2016 are freezing if blocked file is opened. If the file is unblocked manually in properties, docx file is opening fine. how can i fix this?

@lalityay

Thanks for your inquiry. Please ZIP and attach the input and problematic output documents here for testing. We will investigate the issue on our side and provide you more information.

Here it is.
doc.zip (63.5 KB)

@lalityay

Please also share the problematic output document that shows the undesired behavior.

@tahir.manzoor this is the output doc.

@lalityay

Please note that “File Block Settings” is MS Word (Application) level setting and does not store in the document. Therefore it cannot be controlled by Aspose.Words. This is completely controlled by the MS Word.