FYI : Interesting trap using TWPWordConverter

  • We have a large project that may import documents using TWPWordConverter. We also use DUNIT tests but noticed behavioral differences between the DUnit tests and the "real" methods. Basically the DUNIT tests would popup a dialog with the message "microsoft word 97 conversion. Unable to convert graphic"!
    It took a long while but I finally figured out the difference, the DUNIT tests used relative file paths while the application used absolute paths. Using relative paths would cause the TWPWordConverter to use the word 97 convertor instead of the curent word convertor for unknown reasons.

    DUNIT
    filename = '..\projects\dunittest\testdata\RTF_FailedFiles\HeaderProblem.doc'
    convertor used = 'C:\Program Files\Common Files\Microsoft Shared\TextConv\mswrd832.cnv'

    Project
    filename = 'M:\code\medicalobjects_head\projects\dunittest\testdata\RTF_FailedFiles\HeaderProblem.doc'
    convertor used = 'C:\Program Files\Microsoft Office\Office12\Wordcnvpxy.cnv'

    I hope this helps someone avoid the problems I encountered
    Whoops - this should have gone into the version5 forum