Page 1 of 1

Get rid of "Compatibility mode" in Word 365

PostPosted: Fri Feb 22, 2019 4:45 am
by useranon

When opening a .docx in Office 365 the title bar displays "[Compatibility Mode]". Is there a way to get rid of this ?

Say the code is:

Code: Select all
WordprocessingMLPackage wordPackage = WordprocessingMLPackage.createPackage();
MainDocumentPart mainDocumentPart = wordPackage.getMainDocumentPart();
mainDocumentPart.addStyledParagraphOfText("Title", "Hello World!");
File exportFile = new File("hello.docx");;

I am using Docx4j 6.1.1.

I appreciate your help !


Re: Get rid of "Compatibility mode" in Word 365

PostPosted: Wed Mar 13, 2019 6:45 pm
by jason
Sorry for the delay in replying.

If you haven't figured it out already, it is just:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
                DocumentSettingsPart dsp = mdp.getDocumentSettingsPart(true); // where mdp is your MainDocumentPart
                CTCompat compat = Context.getWmlObjectFactory().createCTCompat();
                compat.setCompatSetting("compatibilityMode", "", "15");
Parsed in 0.015 seconds, using GeSHi