Das Notes Forum

Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: el-coto am 26.04.04 - 14:51:48

Titel: Notes und MS Word
Beitrag von: el-coto am 26.04.04 - 14:51:48
Hallo,

kann mir jemand ein Beispielsript senden, womit ich aus einer Notes-Adressdatenbank
per Schaltfläche ein MS Word Briefvorlage mit den Adressfeldern füllen kann.

Alex
Titel: Re:Notes und MS Word
Beitrag von: MartinG am 26.04.04 - 16:05:52
Eines das ich einsetze:

   Dim word As Variant
   Dim wordoc As Variant
   Dim projektpfad As String
   Dim worddateiname As String
   Dim wordpfaddateiname As String
   Dim vorlage_modulablage As String
   
   Dim worddoc As Variant                
   
   Dim uiws As New NotesUIWorkspace
   Dim uidoc As NotesUIDocument
   Dim session As New NotesSession
   Dim doc As NotesDocument
   
   Set uidoc = uiws.CurrentDocument
   Set doc = uidoc.Document
   Set fs = CreateObject("Scripting.FileSystemObject")
   
   
' Pfade / Dateinamen  erstelllen
   vorlage_modulablage = "d:\daten\lotus\konzertvorlage.dot"
   worddateiname = "Konzert.DOC"
         
' Notes Dokument speichern
'   Call uidoc.Save
   
'Create the Word object:
   Set word = CreateObject("Word.Application")    'Create Word object
   Call word.documents.add(vorlage_modulablage)    'Create a new document based on the template
   Set worddoc = word.activedocument    'Get a handle for the active document
   
' Assign the field values:
   worddoc.FormFields("fd_topfeld1").result = uidoc.FieldGetText("fd_konzertort")
   worddoc.FormFields("fd_topfeld2").result = uidoc.FieldGetText("fd_termin")
   worddoc.FormFields("fd_1").result = uidoc.FieldGetText("fd_veranstaltung")
   worddoc.FormFields("fd_1a").result = uidoc.FieldGetText("fd_traeger")
   worddoc.FormFields("fd_2").result = uidoc.FieldGetText("fd_ansprechpartner")
   worddoc.FormFields("fd_3").result = uidoc.FieldGetText("fd_telefonkontakt")
   worddoc.FormFields("fd_4").result = uidoc.FieldGetText("fd_ueberorg")
   worddoc.FormFields("fd_5").result = uidoc.FieldGetText("fd_ubernachtungsort")
   worddoc.FormFields("fd_6").result = uidoc.FieldGetText("fd_paverleiher")
   worddoc.FormFields("fd_7").result = uidoc.FieldGetText("fd_lichtverleiher")
   worddoc.FormFields("fd_8").result = uidoc.FieldGetText("fd_soundcheckzeit")
   worddoc.FormFields("fd_9").result = uidoc.FieldGetText("fd_konzertbeginn")
   worddoc.FormFields("fd_10").result = uidoc.FieldGetText("fd_beginngig")
   worddoc.FormFields("fd_11").result = uidoc.FieldGetText("fd_spieldauer")
   
   worddoc.FormFields("fd_12").result = uidoc.FieldGetText("fd_konzertgage")
   worddoc.FormFields("fd_13").result = uidoc.FieldGetText("fd_fahrtkosten")
   worddoc.FormFields("fd_14").result = uidoc.FieldGetText("fd_gesamtsumme")
   worddoc.FormFields("fd_15").result = uidoc.FieldGetText("fd_mwst")
   worddoc.FormFields("fd_16").result = uidoc.FieldGetText("fd_gesamt_inkl")
      
   word.visible = True
   
Ansonsten:

www.notes.net/sandbox.nsf - suche mal dort nach Word... - da gibt es massig Beispiele...

Gruss
Martin
Titel: Re:Notes und MS Word
Beitrag von: Axel am 27.04.04 - 11:41:05
Hi,

schau auch mal hier: Word-Automation (http://www.free.dominoserver.de/computer/noteslibrary.nsf/d2d59a3d7fc73a2bc1256a6900638352/331dd66d2239a1b2c1256dc50038f49e!OpenDocument)

Ist zwar unter R5 erstellt worden, sollte aber auch unter 6 laufen.


Axel
Titel: Re:Notes und MS Word
Beitrag von: el-coto am 28.04.04 - 08:24:47
Vielen Dank, hat mir sehr geholfen !