Changing layout of document

Hi Support,

There is an option to convert document to MS 97 layout in Microsoft Office. i.e.File-.>Option->.Advanced->Layout-> and a drop down where you have to set the layout to Ms97.

I want to set same property using the Aspose.Words. Please guide me for the requirements.

Thanks.

This message was posted using Email2Forum by Tilal Ahmad Sana.

Hi Mohit,

Thanks for your inquiry. Please use CompatibilityOptions.OptimizeFor method to achieve your requirements. This method allows to optimize the document contents as well as default Aspose.Words behavior to a particular versions of MS Word. Hope this helps you. Please let us know if you have any more queries.

Document doc = new Document(MyDir + "in.docx");
doc.CompatibilityOptions.OptimizeFor(MsWordVersion.Word2007);
doc.Save(MyDir + "Out.docx");

Hi Tahir,

But there is no such option or method available in Aspose word for .net…
if any available please suggest me.

Hi Mohit,

Thanks for your inquiry.

Please use the latest version of Aspose.Words for .NET 14.3.0. Please let us know if you face any issue while using Aspose.Words.

Hi Tahir,

we have the license of Aspose Words for .net, so the new dll will support the old license or not.

Hi Mohit,

Thanks for your inquiry.

Every
Aspose license carries one-year subscription for free upgrades to new
versions released during this time. So, please check the expiration date
of your license and upgrade to the newest version. To check an
expiration date of your license open the license file using notepad. You
will see the following tags:

20140118

It means that you can free upgrade to version of Aspose.Words published before 01/18/2014.

If
you need to update to the latest version of Aspose.Words, but your
license does not allow you to update to this version, you should contact
Aspose sales team to renew your license.
https://forum.aspose.com/c/purchase/6

Hi Tahir,

I used the new dll but the Msversion is not showing any option for 97 it have option from 2000 to 2013

Hi Tahir.

After appliying the ,
Doc.CompatibilityOptions.OptimizeFor(MsWordVersion.Word2003);
the another property
Doc.CompatibilityOptions.DoNotExpandShiftReturn = true;
is not working so the justification problem is coming .
please suggest me any solution both can work together

Hi Mohit,

Thanks for your inquiry.

mohit_tonde:

Hi Tahir,
I used the new dll but the Msversion is not showing any option for 97 it have option from 2000 to 2013

MsWordVersion enumeration allows Aspose.Wods to mimic MS Word version-specific application behavior. Please check MsWordVersion.Word2007. See the attached image for detail.

mohit_tonde:

After appliying the ,
Doc.CompatibilityOptions.OptimizeFor(MsWordVersion.Word2003);
the another property
Doc.CompatibilityOptions.DoNotExpandShiftReturn = true;
is not working so the justification problem is coming .
please suggest me any solution both can work together

It would be great if you please share following detail for investigation purposes.

  • Please attach your input Word document.
  • Please
    share the code which you used to generate
    your output document
  • Please attach the output Word file that shows the undesired behavior.
  • Please
    attach your target Word document showing the desired behavior. You can
    use Microsoft Word to create your target Word document. I will
    investigate as to how you are expecting your final document be generated
    like.

Hi Tahir,
I am sharing the output probleam document with you.
The input docuument and the hole code is quite long,
so i share i piece of code that i used to set a property suggested by you.
My input document are the template with mail marge filed that i replaced with the html data.
so you can chose any dummy once by your self as a input data.

The Document I mention AS ProblemDocument_with_MSViewer2003.docx is Problem do,
When you open it with MsOffice2013 It is totally fine there is no issue, and same as my desire output,
but when you try to open it with the MsViewer2003 then the problem occurs and the following issue start occur Like:
like spacing,
data get cut on scrolling the document

Hi Mohit,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behaviour as MS Word does. If you convert your document e.g ProblemDocument_with_MSViewer2003.docx to Word 2003 file format using MS Word, you will get the same output.

Please convert the document to Word 2003 file format using MS Word 2013 and check the output in MS Word 2003 (in your case, MsViewer2003) and share your findings here for our reference.

Please also share the page number of output document which shows the incorrect output along with screenshot of problematic area.

Unfortunately, it is difficult to say what the problem is without the input/output Document(s) and simplified application. We need your Document(s) and simple project to reproduce the problem. As soon as you get these pieces of information to us we’ll start our investigation into your issue.