| Sub Click(Source As Button) |
| Dim session As New NotesSession |
| Dim ws As New NotesUIWorkspace |
| Dim uidoc As NotesUIDocument |
| Dim db As NotesDatabase |
| Dim land As NotesItem |
| Dim feldZuKopierenIndication As NotesItem |
| Dim feldZuKopierenInhaltIndication As String |
| Dim feldZuKopierenAI As NotesItem |
| Dim feldZuKopierenInhaltAI As String |
| Dim feldZuKopierenBrand As NotesItem |
| Dim feldZuKopierenInhaltBrand As String |
| Dim neu As String |
| |
| Set uidoc = ws.CurrentDocument |
| Set db = session.CurrentDatabase |
| Set doc = New NotesDocument ( db ) |
| |
| 'hole aus dem geöffneten Dokument den Inhalt des zu kopierenden Feldes |
| Set feldZuKopierenIndication = uidoc.Document.GetFirstItem("fldProd_Indications_User") |
| feldZuKopierenInhaltIndication = feldZuKopierenIndication.Text |
| 'Simikolons ersetzen |
| feldZuKopierenInhaltIndication = Evaluate({@ReplaceSubstring("} & feldZuKopierenInhaltIndication & {";";Chr(10)}) 'FEHLER |
| |
| Msgbox feldZuKopierenInhaltIndication 'Ausgabe zum Test |
| Set feldZuKopierenAI = uidoc.Document.GetFirstItem("fldProd_Products_User") |
| feldZuKopierenInhaltAI = feldZuKopierenAI.Text |
| Set feldZuKopierenBrand = uidoc.Document.GetFirstItem("fldProd_Brands_User") |
| feldZuKopierenInhaltBrand = feldZuKopierenBrand.Text |
| |
| 'Land-Feld speichern |
| Set land = uidoc.Document.GetFirstItem("fldCou_Name") |
| Msgbox land.Text |
| |
| 'hier werden alle Dokumente der Maske frmCatalog_Country durchlaufen |
| Dim coll As NotesDocumentCollection |
| Dim docAdmin As NotesDocument |
| Dim itemCopy As NotesItem |
| Set coll=db.search(|Form="frmCatalog_Country"|, Nothing, 0) |
| Set docAdmin=coll.getfirstdocument |
| While Not docAdmin Is Nothing |
| 'prüfen, ob Land übereinstimmt |
| If docAdmin.GetFirstItem("fldCou_Name").Text = land.Text Then |
| 'Inhalt des Feldes ersetzen |
| docAdmin.fldProd_Indications = feldZuKopierenInhaltIndication |
| docAdmin.fldProd_Products = feldZuKopierenInhaltAI |
| docAdmin.fldProd_Brands = feldZuKopierenInhaltBrand |
| 'Dokument speichern und schließen |
| 'Call docAdmin.Save(True,True) |
| Call ws.EditDocument(True,docAdmin) |
| End If |
| 'nächstes Dokument |
| Set docAdmin=coll.getnextdocument(docAdmin) |
| Wend |
| Call uidoc.Document.Save(True,True) 'aktuelles Dokument am Ende noch speichern |
| End Sub |