Hallo Zusammen
Wie ich heute in einem Codebeispiel gesehen habe, scheint es ganz einfach zu sein Formulardaten in eine WordDatei zu senden.
Bisher habe ich Daten von Notes via NotesSQL und ODBC in Word geholt. Z.B. mache ich dies bei einer ERP Applikation so. Dies hat Vor und Nachteile. Vorteil ist, dass schnell neue Vorlagen erstellt werden können, da Word die Daten über ODBC holt und in Notes keine zusätzliche Konfiguration nötig ist. Weniger schön ist es mit NotesSQL, dass die Installation sehr Maschinenabhängig ist und nur mühevoll von mehreren Leuten verwendet werden kann.
Schön ist, dass Notes direkt eine Rechnung anhand einer Wordvorlage erstellen kann. Dies ohne Notes SQL.
* Im Codebeispiel greift Notes auf die Vorlage im Folder C zu. Ist es möglich, dass die Vorlage gleich in einem Dokument gespeichert wird, so dass keine Folderstruktur nötig ist?
* Kann das erstellte Worddokument per Vorlage direkt in das Offene Notes Dokument importiert werden, oder braucht es einen Umweg über einen temporären Ordner (Automatischer Filesave und dann Import)?
* Ich möchte die Dokumente als PDF schliesslich haben. Dazu verwende ich FreePDF, um via virtuellen Drucker PDFs zu erstellen. Kann direkt ein PDF im dynamisch erzeugten Dateinamen erstellt werden und ebenfalls Importiert / gedruckt werden?
Schön wäre, wenn per Knopfdruck eine PDF Offerte direkt in den Auftrag in Notes eingefügt werden würde.
Danke für eure Hilfe!
Grüsse
Manuel
Notes zu Word:
| Sub Initialize |
| Dim officeApp As Variant |
| Dim officeMainDoc As Variant |
| Dim officeSel As Variant |
| Dim officeFields As Variant |
| Dim x As Integer |
| Dim domDoc As NotesDocument |
| Dim domColl As NotesDocumentCollection |
| Dim domSes As New NotesSession |
| Dim domDb As NotesDatabase |
| |
| ' Setting Notes environment |
| Set domDb = domSes.CurrentDatabase |
| Set domColl = domDb.UnprocessedDocuments |
| Set domDoc = domColl.GetFirstDocument |
| |
| ' Setting Word enviornment |
| Set officeApp = CreateObject("Word.Application.9") |
| Set officeMainDoc = officeApp.Documents.Open("c:\MergeMe.doc") |
| Set officeFields = officeMainDoc.FormFields |
| While Not (domDoc Is Nothing) |
| With domDoc |
| officeFields.Item("Company").Result=.CompName(0) & Chr$(13) & .ContName(0) |
| officeFields.Item("Address").Result=.CompAddress(0) |
| officeFields.Item("Zipcity").Result=.CompZip(0) & " " & .CompCity(0) |
| officeFields.Item("Country").Result=.CompCountry(0) |
| officeFields.Item("Today").Result=Str$(Today) |
| officeFields.Item("Regarding").Result=.ContInterest(0) |
| End With |
| ' Print-out |
| 'Call officeMainDoc.PrintOut(True) |
| Set domDoc = domColl.GetNextDocument(domDoc) |
| Wend |
| |
| ' Quit Application / Close the connection |
| ' Wait for all print jobs to finish |
| Print "Waiting for print jobs. No. of pending print jobs: " & Cstr(officeApp.BackgroundPrintingStatus) |
| While officeApp.BackgroundPrintingStatus > 0 |
| ' Wait |
| Wend |
| Print " " ' to delete the earlier print sentence |
| 'Call officeApp.Quit(False) |
| End Sub |
| |
Quelle:
http://www.eview.com/eview/viewr5.nsf/e640f630a3361f84852568f600070fd3/c4798e9fad8e706685256a55007c9563?OpenDocument