Hallo Wolf hallo Svante,


thank You for your reply. Now we tested our created odf documents with
different MS-Word versions. And we found out, that this problem exists in
versions older than MS Word 2013.

Unfortunately our customers will use these older versions.



@Svante:

After confirming the alert dialogs Ms Office displays the document in a
correct way. But we don‘t want our customers to see this alerts.



In the created ODF-document we deleted the version-attribute in the
manifest.xml by hand. In this way the alerts will not be displayed. Would
there be an opportunity to set the version by the simpleOdfApi or by the
ODFDOM-Api?



We also tried to use a odf-template-file, that we created in MS-Word 2010
and save as  „*.odt“:



           TextDocument target = TextDocument.*loadDocument*(
"vorlageWord.odt");

           Paragraph *firstPara* = target.getParagraphByIndex(0, *false*);

           firstPara.appendTextContent("hello World");

           target.save("C:/temp/odf/test.odt");



Now this created file is opened in MS Word without problems. We would
prefer this way. Will this work also, when we insert al lot of different
formatted content ?


Best regards,

Georg











2016-01-11 22:28 GMT+01:00 Svante Schubert <[email protected]>:

> Hello Georg,
>
> I am not able to see the pictures, is MS Office "repairing" the document?
> Have you compared the XML after the repair?
> Microsoft once validated very strict against ODF 1.1 and when ODF 1.2 added
> a new version attribute it states the ODF is invalid.
> Indeed sounds a little like one of those jokes with a Djinn..
>
> The common work around is to make the ODF 1.2 invalid and removing the
> version attribute from the root XML element and avoiding the misleading
> error message from Microsoft.
>
> Best regards,
> Svante
>
>
> On Fri, Jan 8, 2016 at 2:51 PM, Georg Füchsle <[email protected]>
> wrote:
>
> > Hello,
> >
> >
> >
> > I’m a beginner with odf and try to create a small example odf-File using
> > simple-odf  0.8.1:
> >
> >
> >
> > import org.odftoolkit.simple.TextDocument;
> >
> > private TextDocument target;
> >
> > …
> >
> >                     target = TextDocument.*newTextDocument*();
> >
> >                     target.addParagraph("hello world");
> >
> >                     target.save("C:/temp/odf/test.odt");
> >
> >
> > When I open this file with MS Word 2010 (or 2007) then I get this
> message:
> >
> >
> > ​
> >
> >
> > I press the button „ok“ and get this:
> >
> >
> >
> > ​
> >
> > When I press „Ja“, it looks good.
> >
> >
> >
> > ​
> >
> >
> > When I use Apache OpenOffice 4, I don’t get an error and see the line
> > correct.
> >
> > How can I avoid this errors?
> >
> >
> > Our customers will use MS Word. For this reason we try to open it by MS
> > Word too.
> >
>

Reply via email to