Liebe Gemeinde,
ich versuche ein Attachment auf die Platte zu speichern,
leider bekomme ich eine
"Variant does not contain Object" Fehlermeldung bei
der mit -> markierten Zeile.
Was mache ich falsch ?
Gruß
Don Pasquale
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Set db = session.CurrentDatabase
->Set doc = Current.NotesDocument
Dim rtitem As Variant
Set rtitem = doc.GetFirstItem( "Body" )
If ( rtitem.Type = RICHTEXT ) Then
Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
Call o.ExtractFile( "c:\temp\" & o.Source )
Call o.Remove
Call doc.Save( False, True )
End If
End Forall
Hi Rob_Green,
danke für deine Hilfe.
Front-End, Back_End, ok da ist noch ein weiter Weg.
Das Abspeichern des Attachments (immer ein tif) soll aus dem geöffneten Formular erfolgen. Front-End ?
Jetzt bekomme ich ein Type Mismatch.
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Dim rtitem As Variant
Set rtitem = doc.GetFirstItem( "Body" )
If ( rtitem.Type = RICHTEXT ) Then
----> Forall o In rtitem.EmbeddedObjects
If ( o.Type = EMBED_ATTACHMENT ) Then
Call o.ExtractFile( "c:\temp\Ablage\1" & o.Source )
Call o.Remove
Call doc.Save( False, True )
End If
End Forall
End If
Hi Rob,
danke für die Mühe. Ich habe einfach die If-Schleife auskommentiert und nun funzt es. Und das Attachment bleibt erhalten. Es ist zwar noch nicht _die_ Lösung, aber man kann damit arbeiten.
Danke
Don Pasquale
Dim workspace As New NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Set uidoc = workspace.CurrentDocument
Set doc = uidoc.Document
Dim Filename As String
Dim rtitem As Variant
Set rtitem = doc.GetFirstItem( "body" )
If ( rtitem.Type = RICHTEXT ) Then
Forall o In rtitem.EmbeddedObjects
Call o.ExtractFile( "c:\temp\ablage\1\" & o.Source )
Call o.Remove
Call doc.Save(True, True )
End Forall
End If