BOSS 7 ,'' 1 ' '%(8 ((?(g'(J*(K/  ?(%(#( ( 42((N  ( 5 8)&) ,<) -<+ 3n)"Z") ) j2)  ) (  , ) *57*-*iO F/*< *$**3 `>*  %*D** *x*0^9 z * ? 5*&*S**m,59 * !*;*.2 # +* ;*H*7*|b( :*  U"*.*=%* =# *W4 o1***:*q *! *2 },0 (* L *?*6* *f' 07*'- **[ *2*u#A< J* -*)*6 **P/*8 d*j> <* *+*+*E5 ~$*: *_"**y1 3* ( %**T:7 *- ?**n* *3*/$< * Y9*I** *}c9":)Joops.OfficeTalk.ScriptExportCore.Array@replaceOptionobjects  Joops.Scripting.ScriptpersistentObjectdirtynamemethods"&*.2Joops.Scripting.ScriptNameparentglobalCategoryglobalNamecategoryname>BFJN:R6bTextVZ^Core.OrderedCollectionfirstIndexlastIndexjnf @rwithAll:Joops.Scripting.ScriptMethodSourcesourcestartMethodarguments"&*~Joops.Scripting.ScriptMethodName>BFJNVariable`Variable ( name As String, gruppe As String ) 'Hole aus den Prozessdaten gruppe den Eintrag name 'Der Prozessdateneintrag mu ein String sein ! ' 'Arguments: 'name Der Eintragsname 'in Der Gruppenname ' 'Return: 'String Der Wert des Prozessdateneintrags Dim eintrag As String eintrag = processdata.item( name, in: gruppe ) Return eintragStringStringvzEndEnd ( WinWord As SmallCOM.Word.Application ) 'Schliee die Komponente WinWord ' 'Arguments: 'WinWord Die Word Komponente If IsEmpty( WinWord ) = False Then Try WinWord.quit( False, originalFormat: Enum( SmallCOM.Word.WdOriginalFormat, wdWordDocument ), routeDocument: False ) End Try Catch WinWord.quit( False, originalFormat: Enum( SmallCOM.Word.WdOriginalFormat, wdWordDocument ), routeDocument: False ) End Catch End If SmallCOM.Word.ApplicationvzSubstituteSubstitute ( bookmarks As SmallCOM.Word.Bookmarks, label As String, value As String ) 'Ersetzt die Bookmark label mit dem Text value ' 'Arguments: 'bookmarks Alle Textmarken 'label Die zu ersetzende Textmarke 'value Der Ersatztext ' 'Return: 'Boolean False wenn Textmarke label nicht gefunden, ansonsten True Dim bookmark As SmallCOM.Word.Bookmark Dim range As SmallCOM.Word.Range Dim theValue As String If IsEmpty( value ) = True Then theValue = "" Else theValue = value End If Try bookmark = bookmarks.item( label ) End Try Catch Return False End Catch range = bookmark.range range.insertAfter( theValue ) Return TrueSmallCOM.Word.BookmarksStringStringvz "SubstitutesSubstitutes ( document As SmallCOM.Word.Document, marks As Array, values As Array ) 'Ersetzt die Bookmark label mit dem Text value ' 'Arguments: 'document Das Dokument 'marls Die zu ersetzenden Textmarken 'values Die Ersatztext ' 'Return: 'Boolean False wenn eine Textmarke label nicht gefunden, ansonsten True Dim theValue As String Dim bookmarks As SmallCOM.Word.Bookmarks Dim count As Integer Dim i As Integer Dim theMark As String bookmarks = document.bookmarks count = marks.size For i = 1 To count Step 1 theMark = marks( i - 1 ) theValue = values( i - 1 ) If Call Text.Substitute ( bookmarks, theMark, theValue ) = False Then MsgBox( "Im Dokument fehlt die Textmarke '" & theMark & "'", , vbCritical ) Return False End If Next Return TrueSmallCOM.Word.DocumentArrayArrayvz.2>Start&*'Start ( visible As Boolean ) 'Das Makro startet Microsoft Word im sichtbaren oder unsichtbaren Modus ' 'Arguments 'visible Startet WinWord sichtbar oder unsichtbar ' 'Return: 'WinWord Die gestartete Applikation Dim WinWord As SmallCOM.Word.Application Try WinWord = New SmallCOM.Word.Application End Try Catch MsgBox( "Die Kommunikationsbibliothek fr MS-Word istnicht geladen oder MS-Word ist nicht installiert", , vbCritical ) Return Null End Catch If visible = True Then WinWord.visible( True ) End If Return WinWordBoolean6vz:JN^PrintBFPrint ( WinWord As SmallCOM.Word.Application, document As SmallCOM.Word.Document ) 'Drucke das Dokument document aus ' 'Arguments: 'WinWord Die Word Komponente 'document Das auszudruckende Dokument Try document.printOut MsgBox( "Bitte warten Sie mit der Beantwortung, bis der Ausdruck gestartet wurde" ) End Try Catch If MsgBox( "Das Dokument kann nicht gedruckt werden.Ist der Drucker jetzt bereit ?", vbYesNo, vbQuestion ) = 1 Then Call Text.End ( WinWord ) End If End CatchSmallCOM.Word.ApplicationSmallCOM.Word.DocumentRVvzZjn~TypeTextbfTypeText ( selection As SmallCOM.Word.Selection, value As String ) 'Drucke den Text value in die aktuelle Selektion selection ' 'Arguments: 'selection Die aktuelle Selection 'value Der Text If IsNull( value ) = False Then selection.typeText( value ) End If SmallCOM.Word.SelectionStringrvvzzOpen|Open ( WinWord As SmallCOM.Word.Application, fileName As String ) 'ffnet die Datei fileName und liefert das document ' 'Arguments: 'WinWird Die Applikation ' 'Return: 'document Das Dokumentinterface Dim documents As SmallCOM.Word.Documents Dim document As SmallCOM.Word.Document documents = WinWord.documents document = documents.open( fileName ) Return documentSmallCOM.Word.ApplicationStringvzSubstitutePrintTestWSubstitutePrintTest 'Das Makro testet die verschiedenen Ersetz- und Druckfunktionalitten 'Dazu ist die COM-Komponente Microsoft Word und das Dokument Begleitschreiben.doc 'erforderlich Dim fileName As String Dim marks As Array Dim values As Array fileName = Array( CurDir, "\..\Vorlagen\Begleitschreiben.doc" ) marks = Array( "Firma", "Name", "Strasse", "PLZ", "Ort", "vnVorname", "vnNachname", "vnOrt" ) values = Array( "Mnchner Verein", "Fr. Mindel", "Im Kreisel 55", "D-83555", "Mnchen", "Herbert", "Mller", "Baldham" ) Call Text.SubstitutePrint ( fileName, marks, values, True )vzCheckMark;CheckMark ( bookmarks As SmallCOM.Word.Bookmarks, label As String, check As Boolean ) 'Drucke ein X in der Textmarke label wenn check True ist ' 'Arguments: 'bookmarks Alle Textmarken des Dokuments 'label Der Name der gewnschten Textmarke 'check Drucke darauf ein X, wenn True ' 'Return False: wenn Textmarke nicht existiert ' True: X gedruckt oder auch nicht gedruckt ' Dim checked As Boolean checked = True If ( IsEmpty( check ) = False ) And ( check = True ) Then checked = Call Text.Substitute ( bookmarks, label, "X" ) End If Return checkedSmallCOM.Word.BookmarksStringBooleanvzSubstitutePicture!SubstitutePicture ( document As SmallCOM.Word.Document, bookmarkName As String, filename As String ) 'Die Bookmark bookmarkName wird mit dem Bild aus der Datei filename in document ersetzt 'Die Option "ber den Text legen" ist ausgeschaltet ' 'Arguments: 'document Das Dokument 'bookmarkName Der Name der Textmarke an der das Bild eingefgt wird 'filename Der Dateiname des Bildes Dim range As SmallCOM.Word.Range Dim inlineShapes As SmallCOM.Word.InlineShapes Dim bookmarks As SmallCOM.Word.Bookmarks Dim bookmark As SmallCOM.Word.Bookmark bookmarks = document.bookmarks bookmark = bookmarks.item( bookmarkName ) range = bookmark.range range.select inlineShapes = document.inlineShapes inlineShapes.addPicture( filename, linkToFile: False, saveWithDocument: True, range: range )SmallCOM.Word.DocumentStringStringvz &SubstitutePrintSubstitutePrint ( filename As String, marks As Array, values As Array, visible As Boolean ) 'Das Makro ersetzt in dem Dokument filename die Textmarken aus marks 'mit den Werten aus values. Das kann sichtbar oder unsichtbar erfolgen (visible) 'Ein Fehler wird mit einer entsprechender Meldung quittiert ' 'Arguments: 'filename Der Dateiname des Dokuments 'marks Die Textmarken 'values Die einzusetztenden Werte 'visible Die Textersetzung erfolgt sichtbar oder unsichtbar ' 'Return: 'Boolean True/False je nach Durchfhrung Library "..\Library\Microsoft Word Small.pcl" Dim WinWord As SmallCOM.Word.Application Dim document As SmallCOM.Word.Document Dim bookmarks As SmallCOM.Word.Bookmarks Dim count As Integer Dim i As Integer Dim mark As String Dim variable As String If marks.size <> values.size Then MsgBox( "Anzahl der Textmarken und Werte ist nicht gleich", , vbCritical ) Return False End If WinWord = Call Text.Start ( True ) document = Call Text.Open ( WinWord, filename ) bookmarks = document.bookmarks count = marks.size For i = 1 To count Step 1 mark = marks( i - 1 ) variable = values( i - 1 ) If Call Text.Substitute ( bookmarks, mark, variable ) = False Then Call Text.End ( WinWord ) MsgBox( "Im Dokument" & filename & "fehlt die Textmarke '" & mark & "'", , vbCritical ) Return False End If Next Call Text.Print ( WinWord, document ) Call Text.End ( WinWord ) Return TrueStringArrayArrayBooleanvz"26JErsetzen*.WErsetzen ( bookmarks As SmallCOM.Word.Bookmarks, label As String, value As String ) 'Setze im Dokument in die Textmarke label den Text value ein 'Die Anforderung wird an das Makro "Text.Substitute" delegiert. ' 'Return: 'Boolean False wenn Textmarke label nicht gefunden, ansonsten True Call Text.Substitute ( bookmarks, label, value )SmallCOM.Word.BookmarksStringString:>BvzFVZjDruckenNRDrucken ( WinWord As SmallCOM.Word.Application, document As SmallCOM.Word.Document ) Try document.printOut MsgBox( "jetzt wird gedruckt... Bitte warten" ) End Try Catch If MsgBox( "Das Dokument kann nicht gedruckt werden.Ist der Drucker jetzt bereit ?", vbYesNo ) = 1 Then Try document.printOut MsgBox( "jetzt wird gedruckt... Bitte warten", , vbInformation ) End Try Catch MsgBox( "Das Dokument kann wirklich nicht gedruckt werden !", , vbExclamation ) End Catch End If End CatchSmallCOM.Word.ApplicationSmallCOM.Word.Document^bvzfvzClosenrvClose ( WinWord As SmallCOM.Word.Application ) If IsEmpty( WinWord ) = False Then Try WinWord.quit( False, originalFormat: Enum( SmallCOM.Word.WdOriginalFormat, wdWordDocument ), routeDocument: False ) End Try Catch WinWord.quit( False, originalFormat: Enum( SmallCOM.Word.WdOriginalFormat, wdWordDocument ), routeDocument: False ) End Catch End If SmallCOM.Word.Application~vzSaveSave ( WinWord As SmallCOM.Word.Application, document As SmallCOM.Word.Document, filename As String ) 'Save the current document as filename ' 'Arguments: 'WinWord The Word component 'document The current document 'asFilename The filename to be saved as ' 'Returns: 'Boolean True = The document is saved else False Try document.saveAs( filename ) Return True End Try Catch MsgBox( "Document could not be save as " & filename, , vbCritical ) Return False End CatchSmallCOM.Word.ApplicationSmallCOM.Word.DocumentStringvzSaveSave ( WinWord As SmallCOM.Word.Application, document As SmallCOM.Word.Document ) 'Save the current document ' 'Arguments: 'WinWord The Word component 'document The current document ' 'Returns: 'Boolean True = The document is saved, else False Try document.save Return True End Try Catch MsgBox( "Document could not be saved", , vbCritical ) Return False End CatchSmallCOM.Word.ApplicationSmallCOM.Word.Documentvz&Bb*NnvzZ