Outlook 2011: Adding some messages to “Waiting for reply” folder

牧云@^-^@ 提交于 2019-12-13 05:01:32

问题


My use case is that I want to track for responses on some messages I write. My methodology now is to wait for the message to be sent the move it from the sent folder to the "Waiting for reply" folder which I go over periodically.

I'm looking for a way to automate this. Best would be if I press a key which makes Outlook both send the message and put it in the Waiting folder. E.g., by using an applescript.

Alternatively, I thought that pressing a key will add me as BCC, and also add a "WF" string at the bottom of the message. Again, with applescript. Then when I send the message it will also arrive at my Inbox where I'll have a rule to move messages to "Waiting" if they contain "WF"


回答1:


I expanded the script from your other thread to this here:

tell application "Microsoft Outlook"
    -- Simple definition of target mail folder
    -- Works fine this way if only one folder with this name is available
    set waitingForReplyFolder to folder "Waiting for reply"

    -- bring Outlook to front
    activate

    -- remember the front window
    set theWindow to window 1

    -- check it's really draft
    if class of theWindow is not draft window then
        display dialog "Not a draft"
        return
    end if

    -- save the draft
    save theWindow

    -- get the id of the object of the draft window
    set myObjectID to id of (object of theWindow)

    -- close the message window
    close theWindow

    -- checking the message' subject
    set theSubject to subject of message id myObjectID

    -- send the message
    send message id myObjectID

    -- check and wait until Outlook has moved the mail to the sent folder
    -- move it to target folder after we have found it
    set mailFoundAndMoved to false
    repeat 20 times
        -- check the next 20 message ids
        repeat with idCounter from 1 to 20
            try
                set freshSentMail to outgoing message id (myObjectID + idCounter)
                -- check if the subject is the same (just to be safe)
                if subject of freshSentMail is equal to theSubject then
                    -- move the sent mail to the "waiting for reply" folder
                    move freshSentMail to waitingForReplyFolder
                    set mailFoundAndMoved to true
                    exit repeat
                end if
            on error errstr
            end try
        end repeat
        if mailFoundAndMoved then exit repeat
        delay 0.5
    end repeat

end tell

Now you must just see how to trigger this. Open a new message, write the content etc. and run this script. It will send the mail and move it to your target folder, just after it appeared inside the sent folder.

Cheers, Michael / Hamburg



来源:https://stackoverflow.com/questions/26114031/outlook-2011-adding-some-messages-to-waiting-for-reply-folder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!