DOCX Support

<< Click to Display Table of Contents >>

Navigation:  Programming > Load & Save >

DOCX Support

DocX support is available as add-on.

You can order it at: http://www.shareit.com/product.html?productid=300653646

Also see: http://www.wpcubed.com/pdf/_delphi/_wptools/wptools-file-formats/

We recommend Delphi 2009 for unicode support, but it also works with Delphi 7.

 

 

The DocX support units have to be installed into the same directory as WPTools 8.23 or later.

 

Unit WPIoZIPDOCX.pas implements a bridge to the available support to read and write ZIP files.

You can use this with TZipFile included with Delphi XE2 or later or, alternatively, Abbrevia.

Abbrevia is available at http://sourceforge.net/projects/tpabbrevia/  

 

To add DocX support to your application please add the unit

WPIOReadDOCX and WPIoWrtDocX to the project.

 

If you need  to disable DocX support on a condition evaluated at runtime, you can set the global variable WPDOCXDisable to true.

 

 

The DocX writer has this options which can be passed as format string, i.e. to SaveToFile:

 

a) With option -lockfields all the text objects are written as locked fields.

 

b) With the options -DontWriteWPATStrings paragraph names and commands are not saved to bookmarks. Otherwise such names are saved as bookmarks of the form  wp$x=value with x beeing par_basename, par_name,  par_commmand and par_caption.

 

c) With option -activatetrackchanges a special flag will be written in the DocX to make Word activate change tracking.

 

The DOCX writer will also write WPReporter Bands. They are saved as fields with custom parameter strings (which MS Word stores, but otherwise ignores). Unless the fields are updated in MS Word by command  (automatic update is disabled) they are not changed. This means the bands and fields should still work after the document has been opened and changed in MS Word.

 

 

Technical note: The DocX reader supports most features of "Wordprocessing ML" and also loads images stored suing "Drawing ML". It does not support drawing commands such as lines, no themes, table styles and complicated, multi dimensional numbering schemes. (WPTools uses different numbering architecture). VML which has been replaces by DrawingML is currently not supported.

 

The DocX reader has been implemented to expect well formatted XML with correct XMLNS identifiers. It does not use fixed name space names nor uses fixed file names. The writer however writes the "usual" name spaces, i.e. "w:" to avoid incompatibilities which readers which expect this.