2 Replies Latest reply on May 23, 2006 12:11 PM by ksmith

    Convert Word to HTML

      We are developing a web-based application that is supposed to allow users to upload a word document; which we want to automatically convert to HTML so that users can access both the word file and the HTML version of the word file. We installed MS Word 2003 on the server and are running CFMX 6.1. We are using the code taken from the Macromedia web site to do this but cannot seem to get it to work. The file is opened on the server but is not saved as HTML. I think that I need to use a different val() since the sample code indicates that val(8) is for word 2000 and val(10) is for word 97. Does anyone know what the val should be for word 2003? Any help would be greatly appreciated.
        • 1. Re: Convert Word to HTML
          MikerRoo Level 1
          For word 2003, use 8 for standard html. Note that this can create multiple files but may be better than val 9 which could embed binaries like pictures in a single html doc.

          These values are obtained, for all recent word versions, by exploring "WdSaveFormat" in your visual basic reference.
          • 2. Re: Convert Word to HTML
            ksmith Level 1
            Since this article has been published Microsoft has published that they no longer support using MS office for COM automation through server applications. This was published in the release notes for MSOffice 2003 sp2 and other places. They also refer you to the following technote: http://support.microsoft.com/default.aspx?scid=kb;EN-US;257757.

            Your issue is that msoffice seems to require you run it as a user on the box. You can run this code, but you must either start coldfusion using commandline - cfusionmx\bin\cfstart. Alternatively set the service to run as a user instead of as localsystem in the services manager. See http://www.adobe.com/go/tn_17279.

            The best solution will be to create a new method for this under java. Apache Jakarta POI is a project that duplicates office COM automation using java classes. A POI jar file is included in CFMX7. You will need to download it for cfmx6.x and include it in your class path. You may be able to use nearly identical code using cfobject/java against POI classes.