ich versuche eine unterschrift per Javascript in ein word doc zu implementieren


#1
Hallo ich habe ein kleines Problem.

ich möchte gerne eine unterschrift (PNG,etc) in ein Word Dokument implementieren. aber ich finde leider nix Internet dazu.
Dazu sei noch gesagt das ich das ganze in ELO "elektronischer leitz ordner" programmiere.
Es gibt eine variante die das so halbwegs macht aber die ist leider nicht gut dokumentiert"per stempel".

Hier ist mein bisheriger code
Code:
// Test


importPackage(Packages.de.elo.client);
importPackage(Packages.com.jacob.com);
importPackage(Packages.com.jacob.activeX);
importPackage(Packages.com.ms.activeX);
importPackage(Packages.com.ms.com);


//@include lib_jsonparser.js

var iconText103 = "Checkliste für AB";

var txtProjektCheckListeAB;
var txtBauherrCheckListeAB;
var txtArchitektCheckListeAB;
var txtBauvorhabenCheckListeAB;



function getScriptButton103Name() {
return iconText103;
}



function getScriptButtonPositions() {
return "103,Entwicklung,Testen";
}

function eloScriptButton103Start() {
// Icon ToDO
    start103();
}




function start103(){
    var dialogCheckListeAB = workspace.createGridDialog("ELO - Checkliste für Auftragsbestätigungen",25,20);
    var CheckListeABPanel = dialogCheckListeAB.getGridPanel();
//-----------------------------------------------------------------------------------------------------------------------
    var lblProjektCheckListeAB = dialogCheckListeAB.addLabel(1,1,1,"Projektnummer:");
        txtProjektCheckListeAB = dialogCheckListeAB.addTextField(2,1,1);
//-----------------------------------------------------------------------------------------------------------------------
    var lblAngebotCheckListeAB = dialogCheckListeAB.addLabel(4,1,1,"Angebots Nr.");
    var txtAngebotCheckListeAB = dialogCheckListeAB.addTextField(5,1,1);
//-----------------------------------------------------------------------------------------------------------------------
    var lblBauherrCheckListeAB = dialogCheckListeAB.addLabel(1,2,1,"Bauherr:");
        txtBauherrCheckListeAB = dialogCheckListeAB.addTextField(2,2,2);
//-----------------------------------------------------------------------------------------------------------------------
    var lblArchitektCheckListeAB = dialogCheckListeAB.addLabel(1,3,1,"Architekt:");
        txtArchitektCheckListeAB = dialogCheckListeAB.addTextField(2,3,2);
//-----------------------------------------------------------------------------------------------------------------------
    var lblBauvorhabenCheckListeAB = dialogCheckListeAB.addLabel(1,4,1,"Bauvorhaben:");
        txtBauvorhabenCheckListeAB = dialogCheckListeAB.addTextField(2,4,2);
//-----------------------------------------------------------------------------------------------------------------------
    var btnPasstCheckListeAB = dialogCheckListeAB.addButton(4,2,1,"Daten aus Passt","onClickButtonPasstCheckListeAB103");
//-----------------------------------------------------------------------------------------------------------------------
    //                                        Linke seite
    var lbllinks1CheckListeAB = dialogCheckListeAB.addLabel(1,7,1,"Vertragsbedingung:");
    var lbllinks2CheckListeAB = dialogCheckListeAB.addLabel(1,8,1,"Gewährleistung:");
    var lbllinks3CheckListeAB = dialogCheckListeAB.addLabel(1,10,1,"Abrechnung:");
    var lbllinks4CheckListeAB = dialogCheckListeAB.addLabel(1,12,1,"Auftragssumme netto:");
    var lbllinks5CheckListeAB = dialogCheckListeAB.addLabel(1,13,1,"Nachlaß:");
    var lbllinks6CheckListeAB = dialogCheckListeAB.addLabel(1,14,1,"Zahlung innerhalb von (Skonto)");
    var lbllinks7CheckListeAB = dialogCheckListeAB.addLabel(1,16,1,"große Aufträge AZ (US");
    var lbllinks8CheckListeAB = dialogCheckListeAB.addLabel(1,18,1,"Ausführung:");
    var lbllinks9CheckListeAB = dialogCheckListeAB.addLabel(1,20,1,"Besonderheiten:");
//-----------------------------------------------------------------------------------------------------------------------
    //                                        Oben
    var lbloben1CheckListeAB = dialogCheckListeAB.addLabel(2,6,1,"Private Bauherrn:");
    var lbloben2CheckListeAB = dialogCheckListeAB.addLabel(3,6,1,"Prvate Bauherrn mit VOB:");
    var lbloben3CheckListeAB = dialogCheckListeAB.addLabel(4,6,1,"Architekt für priv. Bauherrn:");
    var lbloben4CheckListeAB = dialogCheckListeAB.addLabel(5,6,1,"Firmen:");

    //-----------------------------------------------------------------------------------------------------------------------
    //                                        erste spalte   
    var txtmitte1CheckListeAB = dialogCheckListeAB.addTextField(2,7,1);txtmitte1CheckListeAB.setText("BGB")
    var txtmitte2CheckListeAB = dialogCheckListeAB.addTextField(2,8,1);txtmitte2CheckListeAB.setText("5 Jahre")
    var txtmitte3LCheckListeAB = CheckListeABPanel.addRadioButton(2,10,1,"Aufmaß","","1");
    var txtmitte3RCheckListeAB = CheckListeABPanel.addRadioButton(2,11,1,"pauschal","","1");
    var txtmitte4CheckListeAB = dialogCheckListeAB.addTextField(2,12,1);txtmitte4CheckListeAB.setText("")
    var txtmitte5CheckListeAB = dialogCheckListeAB.addTextField(2,13,1);txtmitte5CheckListeAB.setText("")
    var txtmitte6RCheckListeAB = CheckListeABPanel.addRadioButton(2,14,1,"10 Tage","","2");
    var txtmitte6LCheckListeAB = dialogCheckListeAB.addTextField(2,15,1);txtmitte6LCheckListeAB.setText("")
    var txtmitte7LCheckListeAB = CheckListeABPanel.addRadioButton(2,16,1,"Ja","","3");
    var txtmitte7RCheckListeAB = CheckListeABPanel.addRadioButton(2,17,1,"Nein","","3");
    var txtmitte8RCheckListeAB = CheckListeABPanel.addRadioButton(2,18,1,"nach Absprache","","4");
    var txtmitte8LCheckListeAB = dialogCheckListeAB.addTextField(2,19,1);txtmitte8LCheckListeAB.setText("")
    var txtmitte9CheckListeAB = dialogCheckListeAB.addTextField(2,20,1);txtmitte9CheckListeAB.setText("")
   
//-----------------------------------------------------------------------------------------------------------------------
    //                                        Zweite Spalte
    var txtmitte11CheckListeAB = dialogCheckListeAB.addTextField(3,7,1);txtmitte11CheckListeAB.setText("VOB")
    var txtmitte12RCheckListeAB = CheckListeABPanel.addRadioButton(3,8,1,"4 Jahre","","5");
    var txtmitte12LCheckListeAB = dialogCheckListeAB.addTextField(3,9,1);txtmitte12LCheckListeAB.setText("")
    var txtmitte13LCheckListeAB = CheckListeABPanel.addRadioButton(3,10,1,"Aufmaß","","6");
    var txtmitte13RCheckListeAB = CheckListeABPanel.addRadioButton(3,11,1,"pauschal","","6");
    var txtmitte14CheckListeAB = dialogCheckListeAB.addTextField(3,12,1);txtmitte14CheckListeAB.setText("")
    var txtmitte15CheckListeAB = dialogCheckListeAB.addTextField(3,13,1);txtmitte15CheckListeAB.setText("")
    var txtmitte16RCheckListeAB = CheckListeABPanel.addRadioButton(3,14,1,"10 Tage","","7");
    var txtmitte16LCheckListeAB = dialogCheckListeAB.addTextField(3,15,1);txtmitte16LCheckListeAB.setText("")
    var txtmitte18RCheckListeAB = CheckListeABPanel.addRadioButton(3,18,1,"nach Absprache","","8");
    var txtmitte18LCheckListeAB = dialogCheckListeAB.addTextField(3,19,1);txtmitte18LCheckListeAB.setText("")
    var txtmitte19CheckListeAB = dialogCheckListeAB.addTextField(3,20,1);txtmitte19CheckListeAB.setText("VOB beilegen!")
//-----------------------------------------------------------------------------------------------------------------------
    //                                        dritte spalte
   
    var txtmitte21CheckListeAB = dialogCheckListeAB.addTextField(4,7,1);txtmitte21CheckListeAB.setText("VOB")
    var txtmitte22RCheckListeAB = CheckListeABPanel.addRadioButton(4,8,1,"4 Jahre","","9");
    var txtmitte22LCheckListeAB = dialogCheckListeAB.addTextField(4,9,1);txtmitte22LCheckListeAB.setText("")
    var txtmitte23LCheckListeAB = CheckListeABPanel.addRadioButton(4,10,1,"Aufmaß","","10");
    var txtmitte23RCheckListeAB = CheckListeABPanel.addRadioButton(4,11,1,"pauschal","","10");
    var txtmitte24CheckListeAB = dialogCheckListeAB.addTextField(4,12,1);txtmitte24CheckListeAB.setText("")
    var txtmitte25CheckListeAB = dialogCheckListeAB.addTextField(4,13,1);txtmitte25CheckListeAB.setText("")
    var txtmitte26RCheckListeAB = CheckListeABPanel.addRadioButton(4,14,1,"10 Tage","","11");
    var txtmitte26LCheckListeAB = dialogCheckListeAB.addTextField(4,15,1);txtmitte26LCheckListeAB.setText("")
    var txtmitte28RCheckListeAB = CheckListeABPanel.addRadioButton(4,18,1,"nach Absprache","","12");
    var txtmitte28LCheckListeAB = dialogCheckListeAB.addTextField(4,19,1);txtmitte28LCheckListeAB.setText("")
    var txtmitte29CheckListeAB = dialogCheckListeAB.addTextField(4,20,1);txtmitte29CheckListeAB.setText("")
//-----------------------------------------------------------------------------------------------------------------------
    //                                        vierte spalte
   
    var txtmitte31CheckListeAB = dialogCheckListeAB.addTextField(5,7,1);txtmitte31CheckListeAB.setText("VOB")
    var txtmitte32RCheckListeAB = CheckListeABPanel.addRadioButton(5,8,1,"4 Jahre","","13");
    var txtmitte32LCheckListeAB = dialogCheckListeAB.addTextField(5,9,1);txtmitte32LCheckListeAB.setText("")
    var txtmitte33LCheckListeAB = CheckListeABPanel.addRadioButton(5,10,1,"Aufmaß","","14");
    var txtmitte33RCheckListeAB = CheckListeABPanel.addRadioButton(5,11,1,"pauschal","","14");
    var txtmitte34CheckListeAB = dialogCheckListeAB.addTextField(5,12,1);txtmitte34CheckListeAB.setText("")
    var txtmitte35CheckListeAB = dialogCheckListeAB.addTextField(5,13,1);txtmitte35CheckListeAB.setText("")
    var txtmitte36RCheckListeAB = CheckListeABPanel.addRadioButton(5,14,1,"10 Tage","","15");
    var txtmitte36LCheckListeAB = dialogCheckListeAB.addTextField(5,15,1);txtmitte36LCheckListeAB.setText("")
    var txtmitte38RCheckListeAB = CheckListeABPanel.addRadioButton(5,18,1,"nach Absprache","","16");
    var txtmitte38LCheckListeAB = dialogCheckListeAB.addTextField(5,19,1);txtmitte38LCheckListeAB.setText("")
    var txtmitte39CheckListeAB = dialogCheckListeAB.addTextField(5,20,1);txtmitte39CheckListeAB.setText("VOB beilegen!")
//-----------------------------------------------------------------------------------------------------------------------

    var dialogOKCheckListeAB = dialogCheckListeAB.show();
//-----------------------------------------------------------------------------------------------------------------------

   


   
   
    if(dialogOKCheckListeAB){
//-----------------------------------------------------------------------------------------------------------------------

//                            Spalte 1           

        var txtAbrechnung1 = "";
        if(txtmitte3LCheckListeAB.isSelected()){
            txtAbrechnung1 = "Aufmaß"
        }
        if(txtmitte3RCheckListeAB.isSelected()){
            txtAbrechnung1 = "pauschal"
        }
        var txtSkonto1 = "";
        if(txtmitte6RCheckListeAB.isSelected()){
            txtSkonto1 = "10 Tage" + " " + txtmitte6LCheckListeAB.getText();
        }else{
            txtSkonto1 = txtmitte6LCheckListeAB.getText();
        }
       
        var txtGrAUftrag1 = "";
        if(txtmitte7LCheckListeAB.isSelected()){
            txtGrAUftrag1 = "Ja"
        }
        if(txtmitte7RCheckListeAB.isSelected()){
            txtGrAUftrag1 = "Nein"
        }
       
        var txtAusfuerung1 = "";
        if(txtmitte8RCheckListeAB.isSelected()){
            txtAusfuerung1 = "nach Absprache"
        }else{
            txtAusfuerung1 = txtmitte8LCheckListeAB.getText();
        }
       
//-------------------------------------------------------------------------------------------------------------------------------------------------------

//                            Spalte2

        var txtGewaerleistung2 = "";
        if(txtmitte12RCheckListeAB.isSelected()){
            txtGewaerleistung2 = "4 Jahre"
        }else{
            txtGewaerleistung2 = txtmitte12LCheckListeAB.getText();
        }
       
        var txtAbrechnung2 = "";
        if(txtmitte13LCheckListeAB.isSelected()){
            txtAbrechnung2 = "Aufmaß"
        }
        if(txtmitte13RCheckListeAB.isSelected()){
            txtAbrechnung2 = "pauschal"
        }
       
        var txtSkonto2 = "";
        if(txtmitte16RCheckListeAB.isSelected()){
            txtSkonto2 = "10 Tage" + " " + txtmitte16LCheckListeAB.getText();
        }else{
            txtSkonto2 = txtmitte16LCheckListeAB.getText();
        }
               
        var txtAusfuerung2 = "";
        if(txtmitte18RCheckListeAB.isSelected()){
            txtAusfuerung2 = "nach Absprache"
        }else{
            txtAusfuerung2 = txtmitte18LCheckListeAB.getText();
        }
       
           
//-------------------------------------------------------------------------------------------------------------------------------------------------------

//                                    Spalte3

            var txtGewaerleistung3 = "";
            if(txtmitte22RCheckListeAB.isSelected()){
                txtGewaerleistung3 = "4 Jahre"
            }else{
                txtGewaerleistung3 = txtmitte22LCheckListeAB.getText();
            }
               
            var txtAbrechnung3 = "";
            if(txtmitte23LCheckListeAB.isSelected()){
                txtAbrechnung3 = "Aufmaß"
            }
            if(txtmitte23RCheckListeAB.isSelected()){
                txtAbrechnung3 = "pauschal"
            }
               
            var txtSkonto3 = "";
            if(txtmitte26RCheckListeAB.isSelected()){
                txtSkonto3 = "10 Tage" + " " + txtmitte26LCheckListeAB.getText();
            }else{
                txtSkonto3 = txtmitte26LCheckListeAB.getText();
            }
                       
            var txtAusfuerung3 = "";
            if(txtmitte28RCheckListeAB.isSelected()){
                txtAusfuerung3 = "nach Absprache"
            }else{
                txtAusfuerung3 = txtmitte28LCheckListeAB.getText();
            }
               
               
//-------------------------------------------------------------------------------------------------------------------------------------------------------

//                Spalte4

            var txtGewaerleistung4 = "";
            if(txtmitte32RCheckListeAB.isSelected()){
                txtGewaerleistung4 = "4 Jahre"
            }else{
                txtGewaerleistung4 = txtmitte32LCheckListeAB.getText();
            }

            var txtAbrechnung4 = "";
            if(txtmitte33LCheckListeAB.isSelected()){
                txtAbrechnung4 = "Aufmaß"
            }
            if(txtmitte33RCheckListeAB.isSelected()){
                txtAbrechnung4 = "pauschal"
            }

            var txtSkonto4 = "";
            if(txtmitte36RCheckListeAB.isSelected()){
                txtSkonto4 = "10 Tage" + " " + txtmitte36LCheckListeAB.getText();
            }else{
                txtSkonto4 = txtmitte36LCheckListeAB.getText();
            }
   
            var txtAusfuerung4 = "";
            if(txtmitte38RCheckListeAB.isSelected()){
                txtAusfuerung4 = "nach Absprache"
            }else{
                txtAusfuerung4 = txtmitte38LCheckListeAB.getText();
            }



        var arrSpalte1 = new Array(txtmitte1CheckListeAB.getText(),txtmitte2CheckListeAB.getText(),txtAbrechnung1,txtmitte4CheckListeAB.getText(),txtmitte5CheckListeAB.getText(),txtSkonto1,txtGrAUftrag1,txtAusfuerung1,txtmitte9CheckListeAB.getText())
        var arrSpalte2 = new Array(txtmitte11CheckListeAB.getText(),txtGewaerleistung2,txtAbrechnung2,txtmitte14CheckListeAB.getText(),txtmitte15CheckListeAB.getText(),txtSkonto2,txtAusfuerung2,txtmitte19CheckListeAB.getText())
        var arrSpalte3 = new Array(txtmitte21CheckListeAB.getText(),txtGewaerleistung3,txtAbrechnung3,txtmitte24CheckListeAB.getText(),txtmitte25CheckListeAB.getText(),txtSkonto3,txtAusfuerung3,txtmitte29CheckListeAB.getText())
        var arrSpalte4 = new Array(txtmitte31CheckListeAB.getText(),txtGewaerleistung4,txtAbrechnung4,txtmitte34CheckListeAB.getText(),txtmitte35CheckListeAB.getText(),txtSkonto4,txtAusfuerung4,txtmitte39CheckListeAB.getText())
        var arrEins = new Array(txtProjektCheckListeAB.getText(), onClickButtonPasstCheckListeAB103(),txtAngebotCheckListeAB.getText(),txtBauherrCheckListeAB.getText(),txtArchitektCheckListeAB.getText(),txtBauvorhabenCheckListeAB.getText())
        // ZielPfad bestimmen
        var intFirma = parseInt(txtProjektCheckListeAB.getText().substr(0,1));
        var strJahr = "20" + txtProjektCheckListeAB.getText().substr(1,2);
        var root = archive.getElement(1);
        var path;
        var zielPfad;
        var strProjekt = "" + txtProjektCheckListeAB.getText();
        //workspace.showInfoBox("ELO", "Zeichen Projekt: " + txtProjektTagebuch.getText() + " Zahl " + txtProjektTagebuch.getText().length);
        //workspace.showInfoBox("ELO", "Zeichen Projekt: " + strProjekt + " Zahl " + strProjekt.length);
        //---
       
    if(strProjekt.length > 0){   
        if(strProjekt.length == 7 || strProjekt.length == 6){
            switch(intFirma){
                case 2:
                    path ="¶Löw AG¶Projekte¶" + strJahr + "¶Projekt_" + txtProjektCheckListeAB.getText() + "¶8. Prüfungen¶8.3 Prüfung der Ausführung / Checklisten";
                    zielPfad = root.addPath(path,1);
                    neuesCheckListeAB103(zielPfad, arrEins,arrSpalte1,arrSpalte2,arrSpalte3,arrSpalte4);
                    break;
                case 3:
                    path ="¶Popiolek GmbH¶Projekte¶" + strJahr + "¶Projekt_" + txtProjektCheckListeAB.getText() + "¶8. Prüfungen¶8.3 Prüfung der Ausführung / Checklisten";
                    zielPfad = root.addPath(path,1);
                    neuesCheckListeAB103(zielPfad, arrEins,arrSpalte1,arrSpalte2,arrSpalte3,arrSpalte4);
                    break;
                case 4:
                    path = "¶Sadtler GmbH¶Projekte¶" + strJahr + "¶Projekt_" + txtProjektCheckListeAB.getText() + "¶8. Prüfungen¶8.3 Prüfung der Ausführung / Checklisten";
                    zielPfad = root.addPath(path,1);
                    neuesCheckListeAB103(zielPfad, arrEins,arrSpalte1,arrSpalte2,arrSpalte3,arrSpalte4);
                    break;
                case 5:
                    path = "¶Löw GmbH¶Projekte¶" + strJahr + "¶Projekt_" + txtProjektCheckListeAB.getText() + "¶8. Prüfungen¶8.3 Prüfung der Ausführung / Checklisten";
                    zielPfad = root.addPath(path,1);
                    neuesCheckListeAB103(zielPfad, arrEins,arrSpalte1,arrSpalte2,arrSpalte3,arrSpalte4);
                    break;
                case 7:
                    path = "¶Flughafen¶Projekte¶" + strJahr + "¶Projekt_" + txtProjektCheckListeAB.getText() + "¶8. Prüfungen¶8.3 Prüfung der Ausführung / Checklisten";
                    zielPfad = root.addPath(path,1);
                    neuesCheckListeAB103(zielPfad, arrEins,arrSpalte1,arrSpalte2,arrSpalte3,arrSpalte4);
                    break;
                default:
                    workspace.showInfoBox("ELO", "Die eingeben Projektnummer ist ungültig");
                    break;
                }
            //workspace.showInfoBox("ELO", "der Pfad ist : " + path);
            //workspace.showInfoBox("ELO", "die PfadID ist : " + zielPfad);
        }else{
            workspace.showInfoBox("ELO", "Die eingeben Projektnummer ist ungültig");
        }
       
     }else{
         workspace.showInfoBox("ELO", "geh los");}
     }
   
}


function onClickButtonPasstCheckListeAB103(){
    var abfrage = txtProjektCheckListeAB.getText();//2140847;  //txtProjekt.getText()
    //workspace.showInfoBox("ELO", "Projektnummer; " + abfrage);
    var antwortSQL = workspace.getELOas("vmsrv-elo1",9090,"as-DachuWand",false,"SQLProjektDaten","",abfrage,"");
    var jAntwort = JSON.parse( antwortSQL);
    //var txt = "<br><table><tr><th>Projekt</th><th>Kennung</th><th>Anrede</th><th>Vorname</th><th>Name</th><th>Str</th><th>PLZ</th><th>Ort</th></tr>";
    //log.info("jAntwort.length=["+jAntwort.length+"]");

    // neu in Programmierung aufnehemen   
    var strErgebnisBS = "";
    var strErgebnisKD = "";
    var strErgebnisF1 = "";
    for (var i=0; i < jAntwort.length; i++) {
        //txt += "<tr><td>"+jAntwort[i].PROJEKTNR + "</td><td>"+ jAntwort[i].ADRKENNUNG+ "</td>"+ jAntwort[i].ANREDE+ "</td>"+ jAntwort[i].VORNAME+ "</td>"+ jAntwort[i].NAME+ "</td>"+ jAntwort[i].STRASSE+ "</td>"+ jAntwort[i].PLZ+ "</td>"+ jAntwort[i].ORT+ "</td></tr>";
   
        if(jAntwort[i].ADRKENNUNG=="BS"){
            log.info("jAntwort[i].NAME=["+jAntwort[i].NAME+"]");
            strErgebnisBS = jAntwort[i].NAME+" " + jAntwort[i].PLZ+" "+jAntwort[i].ORT;
            //txtObjektTagebuch.setText(jAntwort[i].NAME+" " + jAntwort[i].PLZ+" "+jAntwort[i].ORT);
        }
        if(jAntwort[i].ADRKENNUNG=="KD"){
            /*
            txtAuftraggeber.setText(jAntwort[i].ANREDE+" "+jAntwort[i].VORNAME+" "+jAntwort[i].NAME+" "+jAntwort[i].STRASSE+" " + jAntwort[i].PLZ+" "+jAntwort[i].ORT);
        */
            strErgebnisKD = jAntwort[i].NAME+" " + jAntwort[i].PLZ+" "+jAntwort[i].ORT;
        }
       
        if(jAntwort[i].ADRKENNUNG=="F1"){
            /*
            txtAuftraggeber.setText(jAntwort[i].ANREDE+" "+jAntwort[i].VORNAME+" "+jAntwort[i].NAME+" "+jAntwort[i].STRASSE+" " + jAntwort[i].PLZ+" "+jAntwort[i].ORT);
        */
            strErgebnisF1 = jAntwort[i].NAME+" " + jAntwort[i].PLZ+" "+jAntwort[i].ORT;
        }
   
    }
    var anzahl = 0;
    anzahl = strErgebnisBS.length;
    var strErgebnis ="";
    if(anzahl > 3){
       
        strErgebnis = strErgebnisBS;
    }else{
       
        strErgebnis = strErgebnisKD;
    }
        txtBauherrCheckListeAB.setText(strErgebnisKD);
        txtArchitektCheckListeAB.setText(strErgebnisF1);
        txtBauvorhabenCheckListeAB.setText(strErgebnisBS);
    return strErgebnis;
}

function neuesCheckListeAB103(parentId,arreins,arrSpalte1,arrSpalte2,arrSpalte3,arrSpalte4){
    // Dokument aus Vorlage erzeugen
    var neuerName = workspace.showSimpleInputBox("ELO","Name für das neue Dokument:",arreins[0] + " - " + arreins[1]);
    if(neuerName != null){
        var vorlageId = 1332256;
//        if(projekt.substring(0,1)=="3"){
//            vorlageId = 1105021;
//        }
        var maske = 57;
        var vorlage = archive.getElement(vorlageId);
        // Benutzerabhäniger Dateipfad auslesen
        var Pfade = workspace.getDirectories();
        var exportPfad = Pfade.getTempDir();
        var exportPfadjava = exportPfad.toString().replace("\\","\\\\");
        //workspace.showInfoBox("ELO",exportPfadjava);
        var file = vorlage.file;
        var ext = utils.getFileExtension(file);
        //var destPath = exportPfadjava + File.separator + vorlage.name.toString() + "." + ext;
        var destPath = exportPfadjava + "\\\\" + vorlage.name.toString() + "." + ext;
        //workspace.showInfoBox("ELO",destPath);
        var destFile = new File(destPath);
        utils.copyFile(file,destFile);
       
        // Dokument in Archiv aufnehmen
        var folder = archive.getElement(parentId);
        var docFileName = destPath;
        var newDocument = folder.prepareDocument(0);
       
       
        newDocument.name=neuerName;
        var newItem = folder.addDocument(newDocument,docFileName);
       
        // Verschlagwortungsmaske setzen und mit Werten der Vorlage befüllen
        newItem.setMaskId(maske);
       
        var sord = newItem.getSord();
        //var alteWerte = new Array();
        //alteWerte = indexWerte;
       
           
            newItem.setObjKeyValue("PROJEKT", arreins[0]);
       
   
        newItem.saveSord();
       
        var newElement = archive.getElement(newItem.id);
        //newElement.checkOut();
        ausCheckListeAB103(newElement.id,arreins,arrSpalte1,arrSpalte2,arrSpalte3,arrSpalte4);
        workspace.setFeedbackMessage("neues Dokument erstellt " + newItem.id);
    }
}

// wird über eine ander Biblithek geladen
function ausCheckListeAB103(dokId,arreins,arrSpalte1,arrSpalte2,arrSpalte3,arrSpalte4){
    // neues Dokument zur bearbeitung öffnen
    var vorlage = archive.getElement(dokId);
    vorlage.checkOut();
   
    var checkDokument = checkout.getLastDocument();
    var dokuname = checkDokument.getDocumentFile();
    //var file = File("c:\\test\\formular.docx");
    var file = dokuname;
    ComThread.InitSTA();

    try{
        var word = new ActiveXComponent("Word.Application");
        var documents = Dispatch.get(word, "Documents").toDispatch();
        var doc = Dispatch.call(documents,"Open", file.path).toDispatch();
       
        var wordfieldProjekt = Dispatch.call(doc,"FormFields","Projekt").toDispatch();
        Dispatch.put(wordfieldProjekt,"Result",arreins[0]);
       
        var wordfieldAngebotNR = Dispatch.call(doc,"FormFields","AngebotNR").toDispatch();
        Dispatch.put(wordfieldAngebotNR,"Result",arreins[2]);
       
        var wordfieldBauherr = Dispatch.call(doc,"FormFields","Bauherr").toDispatch();
        Dispatch.put(wordfieldBauherr,"Result",arreins[3]);
       
        var wordfieldArchitekt = Dispatch.call(doc,"FormFields","Architekt").toDispatch();
        Dispatch.put(wordfieldArchitekt,"Result",arreins[4]);
       
        var wordfieldObjekt = Dispatch.call(doc,"FormFields","Objekt").toDispatch();
        Dispatch.put(wordfieldObjekt,"Result",arreins[5]);
//-----------------------------------------------------------------------------------------------------------------------------------   
       
//                                    Spalte 1
       
        var wordfieldListe22 = Dispatch.call(doc,"FormFields","Liste22").toDispatch();
        Dispatch.put(wordfieldListe22,"Result",arrSpalte1[0]);
       
        var wordfieldListe23 = Dispatch.call(doc,"FormFields","Liste23").toDispatch();
        Dispatch.put(wordfieldListe23,"Result",arrSpalte1[1]);
   
        var wordfieldListe24 = Dispatch.call(doc,"FormFields","Liste24").toDispatch();
        Dispatch.put(wordfieldListe24,"Result",arrSpalte1[2]);
   
        var wordfieldListe25 = Dispatch.call(doc,"FormFields","Liste25").toDispatch();
        Dispatch.put(wordfieldListe25,"Result",arrSpalte1[3]);
   
        var wordfieldListe26 = Dispatch.call(doc,"FormFields","Liste26").toDispatch();
        Dispatch.put(wordfieldListe26,"Result",arrSpalte1[4]);
       
        var wordfieldListe27 = Dispatch.call(doc,"FormFields","Liste27").toDispatch();
        Dispatch.put(wordfieldListe27,"Result",arrSpalte1[5]);
       
        var wordfieldListe28 = Dispatch.call(doc,"FormFields","Liste28").toDispatch();
        Dispatch.put(wordfieldListe28,"Result",arrSpalte1[6]);
       
        var wordfieldListe29 = Dispatch.call(doc,"FormFields","Liste29").toDispatch();
        Dispatch.put(wordfieldListe29,"Result",arrSpalte1[7]);
       
        var wordfieldListe210 = Dispatch.call(doc,"FormFields","Liste210").toDispatch();
        Dispatch.put(wordfieldListe210,"Result",arrSpalte1[8]);
//-----------------------------------------------------------------------------------------------------------------------------------   
       
//                                    Spalte2       

        var wordfieldListe32 = Dispatch.call(doc,"FormFields","Liste32").toDispatch();
        Dispatch.put(wordfieldListe32,"Result",arrSpalte2[0]);
       
        var wordfieldListe33 = Dispatch.call(doc,"FormFields","Liste33").toDispatch();
        Dispatch.put(wordfieldListe33,"Result",arrSpalte2[1]);
   
        var wordfieldListe34 = Dispatch.call(doc,"FormFields","Liste34").toDispatch();
        Dispatch.put(wordfieldListe34,"Result",arrSpalte2[2]);
   
        var wordfieldListe35 = Dispatch.call(doc,"FormFields","Liste35").toDispatch();
        Dispatch.put(wordfieldListe35,"Result",arrSpalte2[3]);
   
        var wordfieldListe36 = Dispatch.call(doc,"FormFields","Liste36").toDispatch();
        Dispatch.put(wordfieldListe36,"Result",arrSpalte2[4]);
       
        var wordfieldListe37 = Dispatch.call(doc,"FormFields","Liste37").toDispatch();
        Dispatch.put(wordfieldListe37,"Result",arrSpalte2[5]);
       
        var wordfieldListe39 = Dispatch.call(doc,"FormFields","Liste39").toDispatch();
        Dispatch.put(wordfieldListe39,"Result",arrSpalte2[6]);
       
        var wordfieldListe310 = Dispatch.call(doc,"FormFields","Liste310").toDispatch();
        Dispatch.put(wordfieldListe310,"Result",arrSpalte2[7]);
                       
//-----------------------------------------------------------------------------------------------------------------------------------   
       
//                        Spalte3       

        var wordfieldListe42 = Dispatch.call(doc,"FormFields","Liste42").toDispatch();
        Dispatch.put(wordfieldListe42,"Result",arrSpalte3[0]);

        var wordfieldListe43 = Dispatch.call(doc,"FormFields","Liste43").toDispatch();
        Dispatch.put(wordfieldListe43,"Result",arrSpalte3[1]);

        var wordfieldListe44 = Dispatch.call(doc,"FormFields","Liste44").toDispatch();
        Dispatch.put(wordfieldListe44,"Result",arrSpalte3[2]);

        var wordfieldListe45 = Dispatch.call(doc,"FormFields","Liste45").toDispatch();
        Dispatch.put(wordfieldListe45,"Result",arrSpalte3[3]);

        var wordfieldListe46 = Dispatch.call(doc,"FormFields","Liste46").toDispatch();
        Dispatch.put(wordfieldListe46,"Result",arrSpalte3[4]);

        var wordfieldListe47 = Dispatch.call(doc,"FormFields","Liste47").toDispatch();
        Dispatch.put(wordfieldListe47,"Result",arrSpalte3[5]);

        var wordfieldListe49 = Dispatch.call(doc,"FormFields","Liste49").toDispatch();
        Dispatch.put(wordfieldListe49,"Result",arrSpalte3[6]);

        var wordfieldListe410 = Dispatch.call(doc,"FormFields","Liste410").toDispatch();
        Dispatch.put(wordfieldListe410,"Result",arrSpalte3[7]);

//-----------------------------------------------------------------------------------------------------------------------------------   
       
//                                        Spalte4

        var wordfieldListe52 = Dispatch.call(doc,"FormFields","Liste52").toDispatch();
        Dispatch.put(wordfieldListe52,"Result",arrSpalte4[0]);

        var wordfieldListe53 = Dispatch.call(doc,"FormFields","Liste53").toDispatch();
        Dispatch.put(wordfieldListe53,"Result",arrSpalte4[1]);

        var wordfieldListe54 = Dispatch.call(doc,"FormFields","Liste54").toDispatch();
        Dispatch.put(wordfieldListe54,"Result",arrSpalte4[2]);

        var wordfieldListe55 = Dispatch.call(doc,"FormFields","Liste55").toDispatch();
        Dispatch.put(wordfieldListe55,"Result",arrSpalte4[3]);

        var wordfieldListe56 = Dispatch.call(doc,"FormFields","Liste56").toDispatch();
        Dispatch.put(wordfieldListe56,"Result",arrSpalte4[4]);

        var wordfieldListe57 = Dispatch.call(doc,"FormFields","Liste57").toDispatch();
        Dispatch.put(wordfieldListe57,"Result",arrSpalte4[5]);

        var wordfieldListe59 = Dispatch.call(doc,"FormFields","Liste59").toDispatch();
        Dispatch.put(wordfieldListe59,"Result",arrSpalte4[6]);

        var wordfieldListe510 = Dispatch.call(doc,"FormFields","Liste510").toDispatch();
        Dispatch.put(wordfieldListe510,"Result",arrSpalte4[7])
       
       
        Dispatch.call(doc,"Save");
           
        var aw = Dispatch.get(doc,"ActiveWindow").toDispatch();
       
        Dispatch.call(aw,"Close");
    }
    catch(e){
        workspace.showInfoBox("ELO","Fehler: " + e);
    }
    ComThread.Release();
   
   
   
   
   
    //workspace.showInfoBox("ELO",dokuname.toString());
    utils.editFile(dokuname);
}
wäre super wenn mir da wer helfen kann

LG

Dariusz Zuber