2013-03-01 17 views
0

我從AHK論壇獲得了此代碼段,我希望我只是缺少一行代碼以獲得成功。我想在INPUTBOX中的一個字符串中有一個用戶類型。然後,我想循環訪問特定郵箱中的所有電子郵件 - 例如「交付」 - 並且當它找到包含該字符串的txt時,在繼續循環中的下一個msg之前採取特定操作。使用AHK搜索Exchange郵箱中的每個msg的TXT - 不是Outlook

有幫助嗎?

Loop, 10 { 
; Loop through all the MailItems in the Inbox Folder 
    MailItems := Folders.item("Deliveries").Items 
    Loop, % MailItems.Count { 
    Item := MailItems.item(A_Index) 
    { 
    ; Add code to copy txt of each msg into a var 
    ; Check if that var CONTAINS the specified string and act accordingly 
    msgtxt: = Item.Body ???? 
    } 

回答

1

由於我沒有Outlook(假設這是電子郵件客戶端)運行,我創建了一些僞代碼來嘗試。不知道這是否會正常運行。我添加了Alt + F12來啓動它。

!F12:: 
InputBox, MySearchString, Search, Please enter a search string. 
Loop, 10 ; Loop through the MailItems in the Deliveries Folder 
{ 
    MailItems := Folders.item("Deliveries").Items 
    Loop, % MailItems.Count 
    { 
     EmailText = MailItems.Body 
     EmailSubject = MailItems.Subject 
     IfInString, EmailText, %MySearchString% 
     { 
      MsgBox, The string: %MySearchString% was found in message: %EmailSubject% . 
      return 
     } 
    } 
} 
+0

唯一的問題是:我不知道循環10是什麼。我剛剛從另一篇文章中複製了該部分。但無論如何,迫不及待要開始工作並嘗試你的版本!謝謝! – dwilbank 2013-03-01 12:19:14

+0

哦,b.t.w.你有沒有試過LookOut。有些人喜歡這個插件。我幾年前嘗試過,並不喜歡它,但那是我的口味。 – 2013-03-01 12:47:38

+0

謝謝。該網站提到我lookeen,這可能也是值得的。 – dwilbank 2013-03-01 12:55:28

相關問題