0

私は AHK フォーラムからこのコードのスニペットを入手しました。成功するにはコードが 1 行欠けているだけで済むことを願っています。ユーザーに INPUTBOX の文字列を入力してもらいたい。次に、特定のメールボックス内のすべての電子メール (「Deliveries」など) をループし、その文字列を含む txt が見つかったら、ループ内の次のメッセージに進む前に特定のアクションを実行します。

ヘルプ?

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 ????
    }
4

1 に答える 1

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
        }
    }
}
于 2013-03-01T12:15:29.313 に答える