Thanks.
I got a bit further. In the preview application I get every step to merge a document, but when normally openoffice writer should open, nothing happens.
This is the content of my word.sh:
/usr/share/applications oowriter Exit
This is the code of the Wordmerge I use:
var vFileHandle as Int // For writing data file var vHeader as String // Data file header line var vData as String // Data file data line var n as Int = 1 // General purpose counter var vSelectedDoc as String // Document selected from menu var vOneOrAll as String // Include record(s) option var F as array[81] of String // Mergeable fields array var vStartingRec = @ResultSetCurrentPosition() var vGoPrint as String
/* This program differs slightly from the one in Appendix 2 of the Sesame Programming Guide. This one gets its list of available merge documents from an external text file (list.txt) instead of the document names being hard-coded into the program. One may then create any number of merge documents, and simply edit the list.txt file (with Notepad) to correspond to the available merge documents */
// Next 4 lines user modifiable var vDataPath as String = "/home/Krisla/Desktop/Sesame/Docs/customer.txt" var vDocsPath as String = "/home/Krisla/Desktop/Sesame/Docs/" var vWordPath as String = "/home/Krisla/Desktop/Sesame/word.sh" var vListPath as String = "/home/Krisla/Desktop/Sesame/Docs/list.txt"
SUBROUTINE PrintCurrentRecordOnly()
If @Askuser("Merge print the " + vSelectedDoc + " for " + vOneOrAll + "?","","") Then {
vGoPrint = "Yes"
n = 1 While F[n] <> "" { vHeader = vHeader + F[n] + "^" vData = vData + @(F[n]) + "^" n = n + 1 }
vFileHandle = fileOpen(vDataPath) fileSeek(vFileHandle, 0) fileWriteLn(vFileHandle, vHeader + @NewLine() + vData) fileClose(vFileHandle)
}
END SUBROUTINE
SUBROUTINE PrintAllRetrievedRecords()
var n as Int var i as Int = 1
If @Askuser("Merge Print " + vSelectedDoc + " for these " + @ResultSetTotal() + " retrieved records?", "( If not, cancel this task, press F7 for a new search,"," and retrieve the records DO you want to print. )") Then {
vGoPrint = "Yes"
n = 1 While F[n] <> "" { vHeader = vHeader + F[n] + "^" n = n + 1 }
vFileHandle = fileOpen(vDataPath) fileSeek(vFileHandle, 0) fileWriteLn(vFileHandle, vHeader)
For n = 1 to @ResultSetTotal()
ResultSetCurrentPosition(n)
While F[i] <> "" { vData = vData + @(F[i]) + "^" i = i + 1 }
FileWriteLn(vFileHandle, vData)
@Msg("Processed Record " + n + " of " + @ResultSetTotal()) vData = "" i = 1
Next
fileClose(vFileHandle)
// Rewind to record where it all started ResultSetCurrentPosition(vStartingRec)
}
END SUBROUTINE
// BEGIN MAIN PROGRAM
// Build documents menu
vSelectedDoc = @PopupMenu( @insert(vListPath), "SELECT MERGE DOCUMENT" )
// Build which record(s) menu
vOneOrAll = @PopupMenu( "THIS Record Only;" + "ALL Retrieved Records;" , "SELECT RECORD(S) TO MERGE PRINT" )
If vSelectedDoc <> "" and vOneOrAll <> "" Then {
// Delete exsting data file. New one will be generated. If FileExists(vDocsPath + vSelectedDoc) Then { fileDelete(vDataPath)
// Fields available for merging F[1] = "Nummer"; F[2] = "Numm.advokaat"; F[3] = "zie notas"; F[4] = "W.K."; F[5] = "Lid KVG"; F[6] = "Mutualiteit"; F[7] = "Naam"; F[8] = "Voornaam"; F[9] = "Voor"; F[10]= "Verhoging door herziening"; F[11]= "Adres"; F[12]= "Nr"; F[13]= "Postnummer"; F[14]= "Gemeente"; F[15]= "Tel."; F[16]= "70"; F[17]= "2de rolnummer"; F[18]= "naam vertegenwoordig(st)er"; F[19]= "beroep t/attest"; F[20]= "adm.beroep/adm.beroep"; F[21]= "betreft"; F[22]= "tegen beslissing"; F[23]= "te verdedigen"; F[24]= "medisch b. op besliss.min."; F[25]= "onderz."; F[26]= "rolnummer"; F[27]= "advokaat"; F[28]= "inleiding"; F[29]= "verdaagd"; F[30]= "bijzondere rol"; F[31]= "doorhaling"; F[32]= "voorkeuze begeleidende arts"; F[33]= "aangestelde deskundige; - dr.1"; F[34]= "- dr.2"; F[35]= "- dr.3"; F[36]= "andere discipline"; F[37]= "discipline"; F[38]= "datum deskundig onderzoek"; F[39]= "inhoud voorlopig verslag"; F[40]= "verslag aan client j/n"; F[41]= "uitstel gevraagd"; F[42]= "bemerkingen"; F[43]= "datum bemerkingen"; F[44]= "inhoud definitief verslag"; F[45]= "110"; F[46]= "tweede eis"; F[47]= "eindzitting"; F[48]= "datum eindvonnis"; F[49]= "inhoud eindvonnis"; F[50]= "advies advocaat h.beroep"; F[51]= "start 2000"; F[52]= "brief zaak afgehandeld"; F[53]= "brief dossier op bureel"; F[54]= "dossier meegenomen"; F[55]= "auditoraat nr."; F[56]= "notas"; F[57]= "huisdokter"; F[58]= "ikvt"; F[59]= "it"; F[60]= "haanb"; F[61]= "mw"; F[62]= "numm.ministerie"; F[63]= "numm.riziv"; F[64]= "verblijf adres"; F[65]= "naam contact adres"; F[66]= "verzaking aanvraag"; F[67]= "zaak beroepscommissie"; F[68]= "gift j/n"; F[69]= "b.numm."; F[70]= "ref. compensatiekas"; F[71]= "lid numm. C.M."; F[72]= "verklaring client"; F[73]= "1"; F[74]= "150"; F[75]= "2"; F[76]= "geboortedatum"; F[77]= "geboortepl."; F[78]= "3"; F[79]= "rijksregister nr."; F[80]= "terug voorkomen";
If vOneOrAll = "THIS Record Only" Then PrintCurrentRecordOnly() Else PrintAllRetrievedRecords()
If vGoPrint = "Yes" Then { // Start Word via Word.bat and pass doc filename. n = @Shell(vWordPath + " " + @Chr(34) + vDocsPath + vselectedDoc + @Chr(34)) If n = 1 Then @MSgbox(vDocsPath + vSelectedDoc,"word.bat not found or something else wrong.","") } } Else @Msgbox(vDocsPath + vSelectedDoc + " doesn't exist.","","Aw shucks!") }
|