Domino 9 und frühere Versionen > ND6: Entwicklung

Import von Antwortdokumenten

(1/1)

Alexis:
Hallo Forum,

in einer Service-Applikation werden Mails in die Datenbank importiert, um sie unabhängig vom Mailsystem zu speichern. Das klappt prima. Nun kommt der Wunsch hoch, auch Antwortmails (Form=Reply) zu importieren.

Von Hand klappt das, jedoch ist dann die Referenz $Ref zu killen. OK.
Mein Script scheitert jedoch, warum auch immer. Der Import klappt einfach nicht. Woran kann das liegen?

Hier der entsprechende Abschnitt:

Set collection = workspace.PickListCollection(1, True, Mailserver,Mailbox,Mailview,"Mail Selection","Select relevant mails.")
   Set doc = collection.GetFirstDocument
   If collection.Count = 0 Then Goto label1
   While Not ( doc Is Nothing )
      Set copydoc = doc.CopyToDatabase( db )
      If doc.Items(13).values(0) = "Reply" Then
         Call doc.ReplaceItemValue( "$Ref", "" )
      End If
      Set doc = collection.GetNextDocument (doc)
   Wend
   Call uidb.OpenView("(Mailview)")
label1:

Kann mir jemand raten?

Alexis

Glombi:
2 Änderungen:

Set collection = workspace.PickListCollection(1, True, Mailserver,Mailbox,Mailview,"Mail Selection","Select relevant mails.")
   Set doc = collection.GetFirstDocument
   If collection.Count = 0 Then Goto label1
   While Not ( doc Is Nothing )
      Set copydoc = doc.CopyToDatabase( db )
      If doc.Items(13).values(0) = "Reply" Then
         Call doc.RemoveItem( "$Ref" )         
         Call doc.Save( true, true, true )
      End If
      Set doc = collection.GetNextDocument (doc)
   Wend
   Call uidb.OpenView("(Mailview)")
label1:


Andreas

Alexis:
Danke Andreas,

klappt wie geschmiert!

Alexis

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln