2
votes

I'm using Delphi to open a MS Word .doc document and save it as a text file. What I need to do now is to save it as a .odt file.

I can't find the filter properties I should use.

This is the code snippet for the save-to-text-file functionality:

  wProperties := VarArrayCreate([0, 0], varVariant);
  wProperties[0] := MakePropertyValue('FilterName', 'Text');

  fDocument.StoreAsURL('file:///'+ StringReplace(FileName, '\', '/', [rfIgnoreCase,     rfReplaceAll]), wProperties);

Filename would have something like "c:\temp\aaa.txt" .

What filter name value should I use to store as an odt file?

Note: I'm actually using LibreOffice if that makes any difference.

2

2 Answers

2
votes

The filter name that you need to use is 'writer8'.

0
votes

There's a Wiki filterlist as API Names online: Filterlist as API Name for Property Values