* check for docx > lnH=Fopen(lcFromFile,10) > lcHeader=Fread(lnH, 2) > Fclose(lnH) >* signature of Phil Katz means this is a zip, i.e. a zipped directory structure of xml files, i.e. a docx > >*!* Constant Description >*!* 1 - ANSI text Text in Windows ANSI format (an end of a paragraph is marked with the control characters 13 and 10). >*!* 2 - TX text Text in ANSI format (an end of a paragraph is marked only with the control character 10). >*!* 3 - TX Text including formatting attributes in the internal Text Control format. Text is stored in ANSI. >*!* 4 - HTML HTML format (Hypertext Markup Language). >*!* 5 - RTF RTF format (Rich Text Format). >*!* 6 - Unicode text Text in Windows Unicode format (an end of a paragraph is marked with the control characters 13 and 10). >*!* 7 - TX text Text in Unicode format (an end of a paragraph is marked only with the control character 10). >*!* 8 - TX Text including formatting attributes in the internal Text Control format. Text is stored in Unicode. >*!* 9 - Microsoft Word 97-2003 Microsoft Word 97-2003 format (*.doc). >*!* 10 - XML XML format (Extensible Markup Language). >*!* 11 - CSS CSS format (Cascading Style Sheet). >*!* 12 - Adobe PDF >*!* 13 - Microsoft Word Microsoft Word format (*.docx). > > lnType=Icase(lcHeader="PK", 13, 9) > > loTx.Load(lcFromFile, 0, lnType) > lnRet=loTx.Save(tcTargetFile, 0, 12) > This.nDocCnt = This.nDocCnt + 1 > If lnRet=0 > This.oLog.Log("PDF maker reports error ") > Endif > loTx.ResetContents() > Return lnRet>0>You'd have different last parameters in .save() and .load(), but that's it.