Outlook 2011 - Accessing/Removing Recipients
Outlook 2011 - Accessing/Removing Recipients
- Subject: Outlook 2011 - Accessing/Removing Recipients
- From: Dave <email@hidden>
- Date: Thu, 30 Apr 2015 16:06:21 +0100
Hi All,
I’m trying to remove a recipient from an Outlook Email, using the Script below which doesn’t work.
Could someone tell me what I am doing wrong? It doesn’t even detect “email@hidden” in the “if” statement, even though the log shows it as being there?
Thanks in advance.
Dave
————————————————————————————————
on run
tell application id "com.microsoft.Outlook"
activate
set myEmailAddressList to {}
set myMessageList to current messages
set myMessage to item 1 of myMessageList
repeat with myRecipient in recipients of myMessage
set myEmailAddress to email address of myRecipient
set myEmailAddressString to address of myEmailAddress
copy myEmailAddressString to end of myEmailAddressList
end repeat
log myEmailAddressList
repeat with myEmailAddress in myEmailAddressList
log "myEmailAddress: " & myEmailAddress
if myEmailAddress is equal to "email@hidden" then
beep
log "FOUND!"
delete (recipient in myMessageList whose email address = myEmailAddress)
log "Delete recipient: " & myEmailAddress
end if
end repeat
return "OK"
end tell
end run
————————————————————————————————
Log:
(*email@hidden, email@hidden)
(*myEmailAddress: email@hidden*)
(*myEmailAddress: email@hidden)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden