| Dim session As New NotesSession |
| Dim db As NotesDatabase |
| Dim collection As NotesDocumentCollection |
| Dim doc As NotesDocument |
| Dim MergeDoc As NotesDocument |
| Dim MergeView As NotesView |
| Dim rtitem As NotesRichTextItem |
| Dim w As New NotesUIWorkspace |
| Dim WordDocs As Variant |
| Dim WordDoc As Variant |
| Dim WordDoc2 As Variant |
| Dim object As Variant |
| Dim WordObj As Variant |
| Dim range As Variant |
| Dim tableobj As Variant |
| Dim i As Integer |
| Dim temp As String |
| Dim templateName As String |
| |
| '********************************************** |
| ' Dim doc As NotesDocument |
| ' Dim session As New NotesSession |
| ' Dim db As NotesDatabase |
| Dim user As String |
| Dim Reaktionsbriefpfad As String |
| Set db = session.CurrentDatabase |
| |
| user = session.UserName |
| Set doc = db.GetProfileDocument( "e4frmProfil" , user ) |
| Reaktionsbriefpfad = doc.Serien_1_Pfad(0) |
| '********************************************** |
| |
| |
| Set db = session.CurrentDatabase |
| Dim dlgDoc As New NotesDocument(db) |
| OK=False |
| OK=w.dialogbox("TemplatePicker", True, True, False, False, False, False, "Choose Template",dlgDoc) |
| If OK Then |
| templateName=dlgDoc.templatechoices(0) |
| Set MergeView = db.GetView( "Serienbriefvorlagen" ) |
| Set MergeDoc = MergeView.GetDocumentByKey(templateName,True) |
| ' Das Attachment wird abgespeichert unter Reaktionsbriefpfad |
| |
| If MergeDoc.HasEmbedded Then |
| Set rtitem = doc.GetFirstItem( "Body" ) |
| If ( rtitem.Type = RICHTEXT ) Then ' **************** OBJECT VARIABLE NOT SET |
| Forall o In rtitem.EmbeddedObjects |
| If ( o.Type = EMBED_Attachment ) Then |
| 'Messagebox o.name |
| Call o.ExtractFile ( Reaktionsbriefpfad & "\" & Filename1 ) 'Anhang auf Laufwerk "Pfad" speichern |
| End If |
| End Forall |
| End If |
| End If |
| End If |
| |