Das Notes Forum
Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: MrMagoo am 06.01.04 - 10:37:14
-
Hallo,
ich verwenden einen Agenten zum lösen von Anhängen.
http://www.atnotes.de/index.php?board=9;action=display;threadid=10524
Wenn der Anhang jetzt aber zb. ein eingebettetes Dokument bzw. eine auszufüllende Maske ist, dann gibt er an folgender Stelle die Fehlermeldung "Object Variable not set"
If ( rtitem.Type = RICHTEXT ) Then
...
Kann mir jemand helfen?
-
Hi,
du könntest doch mit rtitem.type prüfen, ob es sich um ein Attachment handelt und nur dann lösen.
If (rtitem.type = ATTACHMENT) Then
...
-
@driri
Funktioniert leider nicht, gleiche Fehlermeldung.
-
Ist das Dokument schon einmal gespeichert worden, wenn der Agent läuft?
Falls nicht, liegt es daran, dass RT Felder erst nach dem Speichern bekannt sind.
Das hatte wir letztens schon mal hier - es war soagr fast der gleiche Code.
Andreas
-
Also jetzt habe ich den genauen Sachverhalt:
in der Mail ist einmal ein Anhang (normales Worddocument)
aber auch eine auszufüllenden Maske, mit verschiedenen Feldern. Ich denke daran liegt es, kann das abgefangen werden?
-
Hi,
das hab ich in der Designer-Hilfe gefunden:
Examples: EmbeddedObjects property
This script goes through all the file attachments, object links, and embedded objects in the Body item of a document. Each time it finds a file attachment, it detaches the file to the SAMPLES directory on the C drive and removes the attachment from the document. The script has no effect on the object links or embedded objects in the Body item.
Dim doc As NotesDocument
Dim rtitem As Variant
'...set value of doc...
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:\samples\" & o.Source )
Call o.Remove
Call doc.Save( False, True )
End If
End Forall
End If
Hier wird mit If ( o.Type = EMBED_ATTACHMENT ) Then geprüft, ob es sich um ein Attachment handelt und erst dann wird der Anhang gelöst.
Ändere mal deinen Agenten entsprechend ab und versuch's mal. Vielleicht bringt dich das weiter.
Axel
-
Danke nochmal für Eure mühe. Das eigentliche Problem (hab ich vorher leider nicht erkannt) ist, das die Schablone, dieser einen Mail verändert wurde und es somit nicht funktionieren konnte.
Danke nochmal!