Das Notes Forum

Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: medom am 03.09.02 - 11:28:09

Titel: Mail in string variablen abspeichern. würd mir vie
Beitrag von: medom am 03.09.02 - 11:28:09
Hi,
wir bekommen am tag mehere hundet mails von einen server.
jetzt wollte ich mit lotus script den inhalt der mail auswerten. aber ich schaffe es leider nicht den inhalt der mail in eine string variable zu schreiben.

wäre nett wenn einer mir einen tipp geben könnte wie ich das am besten mache, da ich sonst über 13.000 mails per hand durchgehen müßte.

Danke
Titel: Re: Mail in string variablen abspeichern. würd mir
Beitrag von: Rob Green am 03.09.02 - 11:39:57
die Methode nennt sich GetFormattedText aus der RT Item Class. Holt sich den Inhalt als String und hat nix mit Formatierungen zu tun.

Notes Help

1.      This script gets the Body item in a document, and writes its contents to a plain text file called PLANE.TXT. Any existing text in the file is written over. The text keeps its tabs and the default line wrapping is used.


Dim doc As NotesDocument
Dim rtitem As Variant
Dim plainText As String
Dim fileNum As Integer
'...set value of doc...
Set rtitem = doc.GetFirstItem( "Body" )
If ( rtitem.Type = RICHTEXT ) Then
 plainText = rtitem.GetFormattedText( False, 0 )
End If
' get a file number for the file
fileNum = Freefile
' open the file for writing
Open "c:\plane.txt" For Output As fileNum
' write the formatted text to the file
Print #fileNum, plainText
' close the file
Close #fileNum
Titel: Re: Mail in string variablen abspeichern. würd mir
Beitrag von: medom am 03.09.02 - 13:28:16
Hi,
wen ich folgenden code im agenten eingebe:
Code

Sub Initialize
     Dim doc As NotesDocument
     Dim rtitem As Variant
     Dim plainText As String
     Dim fileNum As Integer
     
     
     
     Set rtitem = doc.GetFirstItem( "Body" )
     If ( rtitem.Type = RICHTEXT ) Then
           plainText = rtitem.GetFormattedText( False, 0 )
     End If
     
     
End Sub



und den agenten starte dann kommt immer ein popupfenster mit: object variable not set.  ???

der meldung tritt immer bei dieseer zeile auf:

Set rtitem = doc.GetFirstItem( "Body" )

MfG
Markus

Titel: Re: Mail in string variablen abspeichern. würd mir
Beitrag von: Zimmi am 03.09.02 - 13:31:22
Hallo medom,

du hast wahrscheinlich das doc vergessen.

Oder hast du die Zeile nicht mit angegeben ...
Set doc = uidoc.document
... oder sowas muss da noch rein ...

Grüße von
Zimmi
Titel: Re: Mail in string variablen abspeichern. würd mir
Beitrag von: medom am 03.09.02 - 14:33:11
ja das wars :)

Danke an euch zwei