Domino 9 und frühere Versionen > Entwicklung
Mail in string variablen abspeichern. würd mir vie
(1/1)
medom:
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
Rob Green:
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
medom:
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
--- Ende Code ---
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
Zimmi:
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
medom:
ja das wars :)
Danke an euch zwei
Navigation
[0] Themen-Index
Zur normalen Ansicht wechseln