Domino 9 und frühere Versionen > ND6: Entwicklung

Bilder aus Notes DB exportieren

<< < (5/6) > >>

Peter Klett:
Ne, Gerhard meint, wenn kein Bild angehängt ist.

If Isarray (rtitem.EmbeddedObjects) Then
   ...

Wenn kein Dateianhang vorhanden ist, ist EmbeddedObjects kein Array.

klaussal:

--- Zitat ---bzw. nicht vorhanden ist
--- Ende Zitat ---

Hatte ich etwas anders verstanden.

Peter Klett:
Klar, Du hast Recht, das habe ich überlesen.

Also braucht er beide Überprüfungen, ob das Item da ist, und wenn es da ist, ob Anhänge vorhanden sind.

Gerhard:
DAnke an alle, super, habe das nun eingebaut und es läuft ohne Fehler durch. DA ich nun zu viele Bilder habe nehme ich an dass er alle Dokumente aus der DB genommen hat. Ich möchte das aber auf eine View einschränken, es dürften eben nur die erwähnten 1317 sein. Wie kann ich nun noch eine Vorselektion mittels einer View hier einbauen ?

Sub Initialize
   Dim session As New NotesSession
   Dim db As NotesDatabase
   Dim dc As NotesDocumentCollection
   Dim doc As NotesDocument
   Dim rtitem As Variant
   Dim fileCount As Integer
   fileCount = 0   
   
   Set db = session.CurrentDatabase
   Set dc = db.AllDocuments
   
   If dc.Count > 0 Then
      Set doc = dc.GetFirstDocument
      While Not (doc Is Nothing)
         If doc.HasItem("Bild_A4") Then            
            Set rtitem = doc.GetFirstItem( "Bild_A4" )
            If Isarray (rtitem.EmbeddedObjects) Then
               If ( rtitem.Type = RICHTEXT ) Then
                  Forall o In rtitem.EmbeddedObjects
                     If ( o.Type = EMBED_ATTACHMENT ) Then
                        fileCount = fileCount + 1
                        Call o.ExtractFile ( "h:\dekor_attachments\" & o.name)
                        Call doc.Save( True, True )
                     End If
                  End Forall
               End If   
            End If
         End If
         Set doc = dc.GetNextDocument(doc)
      Wend
   End If
End Sub

klaussal:
dim view as Notesview

set view = db.getview("deineansicht")


Set doc = view.Getfirstdocument

bzw

set doc = view.getnextdocument

Alles, was mit dc zu tun hat, auskommentieren oder löschen.

Navigation

[0] Themen-Index

[#] Nächste Seite

[*] Vorherige Sete

Zur normalen Ansicht wechseln