2011-06-01 25 views

回答

1

如果您熟悉腳本語言,我建議您使用LotusScript代替。它使您可以直接訪問Notes對象而不是Applescript and the Notes C API

您可以使用Notes Designer應用程序在郵箱內創建Notes代理。該代碼將大致是這樣的:

Dim s as New NotesSession 
Dim db as NotesDatabase 
Dim dc as NotesDocumentCollection 
Dim doc as NotesDocument 

Set db = s.CurrentDatabase 
Set dc = db.Search(|Form="Memo"|, Nothing, 0) 
Set doc = dc.GetFirstDocument 

While Not (doc Is Nothing) 

    'Process each document here... 

    Set doc = dc.GetNextDocument(doc) 
End While 

的問題是如何存儲在每個郵件正文中的電子郵件地址,帳號和姓名?

您可以將電子郵件正文中的所有文本拖入大文本文件中,然後使用Applescript處理,如果您對此更加適應。

fileNum = Freefile() 
pathname = "C:\path\to\file" 
Open pathname For Output As fileNum 
While Not (doc Is Nothing) 

    Set rtitem = doc.GetFirstItem("Body") 
    Write #fileNum, rtitem.GetFormattedText(False, 0) 

    Set doc = dc.GetNextDocument(doc) 
End While 
Close fileNum 

或者您可以使用NotesRichTextItem方法來導航並從正文中提取特定數據。如果數據存儲在電子郵件正文中的表中,這可能很有用,因爲NotesRichTextItem方法允許您查找表格元素並導航單元格(儘管這很困難,並且可能值得發佈第二個問題在StackOverflow上獲得幫助)。

如果你希望獲得的電子郵件地址和名稱來自收件人:或From:電子郵件的領域,你可以通過訪問NotesDocument的每封電子郵件的性能做更容易。這些字段可以像這樣提取:

Dim ToEmail as String 
Dim FromEmail as String 

ToEmail = doc.SendTo(0) 'a document's item properties are zero-based arrays 
FromEmail = doc.From(0) 
+0

非常感謝您的好消息!我希望我能+10你的回覆!從我所能告訴的我沒有蓮花腳本的環境 – 2011-06-02 12:28:31

+0

你有權訪問Notes設計師嗎?或者也許你能從另一臺機器上獲得它? Applescript選項對我來說似乎令人望而生畏,尤其是在文檔太少的情況下。 – 2011-06-02 15:10:28

+0

它並沒有出現。我已經看到了我能想到的任何地方,甚至在此過程中解決了Notes幫助問題。 :) 但不是。看起來我被阻止了。我贊同你。非常感謝你的幫助! – 2011-06-02 15:54:46

相關問題