scripting Outlook 2016

I literally just finished building a script that parses an incoming message and creates a JIRA ticket based on the content. Today I was “upgraded” to Outlook 2016 and the script is throwing an error. It seems to take issue with the “current message” term. The only solution I’ve found is to change that to “selected” but that doesn’t work either. Below is the Outlook portion of the code.

Any thoughts?


tell application "Microsoft Outlook"
	-- get the currently selected message or messages
	set selectedMessages to current messages
	-- if there are no messages selected, warn the user and then quit
	if selectedMessages is {} then
		display dialog "Please select a message first and then run this script." with icon 1
	end if
	repeat with theMessage in selectedMessages
		-- get the information from the message, and store it in variables
		set theSubject to subject of theMessage
		--set theCategory to category of theMessage
		set theContent to plain text content of theMessage as text
	end repeat
end tell

That works for me with Outlook 2016 v15.40 and Sierra 10.12.6.

Think I have it!

Kerflooey, could you check to see if your Reminders window is open when the script is functioning? I’m curious if the bug has persisted into 15.40 or if you simply don’t have the Reminders window open.

Adding the block to close the Reminders allows my script to run, but when I put in the second block to re-open Reminders, it does not run. The journey continues…


Hi, I do not have a Reminders window open when I run the script.

My guess is that if you opened Reminders, that the script would have issues for you as well.

Thanks again.