• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Outlook 2011 - Accessing/Removing Recipients
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Outlook 2011 - Accessing/Removing Recipients
      • From: Christopher Stone <email@hidden>
    • Re: Outlook 2011 - Accessing/Removing Recipients
      • From: Axel Luttgens <email@hidden>
  • Prev by Date: Re: WTH? Evil Returns
  • Next by Date: Outlook 2011 - Accessing/Removing Recipients
  • Previous by thread: Re: Scripting Mail: Body content as plain text with quotes
  • Next by thread: Re: Outlook 2011 - Accessing/Removing Recipients
  • Index(es):
    • Date
    • Thread