Ignore:
Timestamp:
2011-06-15T21:28:38+12:00 (13 years ago)
Author:
ak19
Message:

Docx to html with windows Scripting. Thanks to Veronica who found a VBScript that can launch Word in the background and do the conversion of docX to HTML now (for when the user has word). Modified the script to work with cmd line parameters and to run Word in invisible mode. gsConvert.pl now calls on docx2html.vbs if the inputfile is docx, else it still calls the default word2html.exe VB program as before to do windows scripting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/gsConvert.pl

    r24124 r24164  
    789789                       $ENV{'GSDLOS'}, "word2html");
    790790
    791     $vbScript = "word2html" if ($ENV{'GSDLOS'} =~ m/^windows$/i);
     791    if ($ENV{'GSDLOS'} =~ m/^windows$/i) {
     792    # if windows scripting with docx input, use new VBscript
     793    if($input_filename =~ m/docx$/i) {
     794        $vbScript = "docx2html.vbs";
     795    } else { # use the usual word2html conversion VB executable
     796        $vbScript = "word2html";
     797    }
     798    }
     799
    792800    if (-e "$output_filestem.html") {
    793801    print STDERR "    The conversion file:\n";
     
    811819    if (system($cmd)!=0)
    812820    {
    813     print STDERR "Error executing word2Html converter:$!\n";
     821    print STDERR "Error executing $vbScript converter:$!\n";
    814822    if (-s "$output_filestem.err") {
    815823        open (ERRFILE, "<$output_filestem.err");
Note: See TracChangeset for help on using the changeset viewer.