... probiers mal damit...
' # Überprüft die Dateianhänge eines Richtext-Feldes auf Grafiken - hier gif, jpg, jpeg und bmp
' # Der Code kann zum Beispiel in einer AKtion oder Schaltfläche verwendet werden
' # ... Man kann aus diesem Code eine Funktion bilden
' # ... als Rückgabe kann das Array sObjName() die Namen aller Dateianhänge liefern...
' # ... ata
Dim ws As New NotesUIWorkspace
Dim docThis As NotesDocument
Dim rtSource As NotesRichTextItem
Dim object() As NotesEmbeddedObject
Dim sObjName() As String
Dim sSource As String
Dim ob As Integer
Dim dotPos As Integer
Dim suffix As String
'
ob = -1
sSource = "Attachments"
Set docThis = ws.CurrentDocument.Document
Set rtSource = docThis.GetFirstItem(sSource)
'
If rtSource Is Nothing Then Goto Cancel
'
If rtSource.Type = 1 Then
If Not Isarray(rtSource.EmbeddedObjects) Then Goto Cancel
Forall obj In rtSource.EmbeddedObjects
ob = ob + 1
Redim Preserve object( 0 To ob)
Redim Preserve sObjName( 0 To ob)
Set object( ob ) = obj
sObjName( ob ) = obj.Name
dotPos = Instr(sObjName( ob ) , ".")
If dotPos > 0 Then
suffix = Right( sObjName( ob ) , Len(sObjName( ob ) )-dotPos )
If Lcase(suffix) = "gif" Or Lcase(suffix) = "jpg" Or Lcase(suffix) = "jpeg" Or Lcase(suffix) = "bmp" Then
Print sObjName( ob ) + " ist eine Grafik"
End If
End If
End Forall
Else
' # ... kein Richtext-Feld
Goto Cancel
End If
Cancel:
ata