Das Notes Forum

Domino 9 und frühere Versionen => ND6: Entwicklung => Thema gestartet von: Alexis am 12.05.05 - 15:46:52

Titel: Import von Antwortdokumenten
Beitrag von: Alexis am 12.05.05 - 15:46:52
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
Titel: Re: Import von Antwortdokumenten
Beitrag von: Glombi am 12.05.05 - 16:11:08
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
Titel: Re: Import von Antwortdokumenten
Beitrag von: Alexis am 12.05.05 - 16:21:17
Danke Andreas,

klappt wie geschmiert!

Alexis