My Outlook 2011 Macros

After a quick review earlier today, I realized that I have not posted most of my Outlook 2011 macros. If you are interested in any from the below list, reply here and I will cleanup and post the macro.

Some of these are very specific to my needs and workflows, and may not be useful to others without substantial changes.

My apologies for the brief, and perhaps cryptic, Macro Titles.

My Outlook 2011 Macros

  1. OL Apply Normal Font to Selection
  2. OL Apply Std Style to Outlook Message
  3. OL Apply Yellow Highlight
  4. OL Collapse All Groups
  5. OL Copy EMail & Paste Into Evernote (Outlook)
  6. OL Delete Old Completed Outlook Tasks
  7. OL End Key – Go To Bottom
  8. OL Find [SUB]
  9. OL FWD EWT Options Trade to Evernote
  10. OL FWD EWT WE & Alerts to Evernote
  11. OL FWD Orders to Evernote
  12. OL FWD to Evernote
  13. OL Home Key – Go To Top
  14. OL Horizontal Line
  15. OL REPLY to SD6 Message
  16. OL Reset - Go to Inbox Top Message
  17. OL Select Line and Set Color to Blue
  18. OL SUB Cleanup EWT Trade Table
  19. OL SUB Find & Copy Line
  20. OL SUB FWD EWT Part 1 - Open EMail to Get Date & Author
  21. OL SUB Set Recipient to EN EMail
  22. OL TDA Parse Buy/Sell Trade to Reformat Trade Line
  23. OL Toggle INDENT of HTML Reply and FWD in Outlook 2011

Hi JMichaelTX,
Do you have a macro handy for replying to email with a standard greeting for Outlook 2016 (15.33)? Something like “Hi, [firstname]”.

Jesper, I didn't have a macro/script for this, but here is a script I wrote quickly that should work. Note that it is for Outlook 2011. I don't have Outlook 2016, but it should work. You may need to make some adjustments.

Just put it in a KM Execute AppleScript Action, and you should be good to go.

NOTICE: This script has had very limited testing. Use at your own risk.

AppleScript to Create Outlook 2011 Reply

  Reply to Outlook Message with Sender Name

VER:   1.0    LAST UPDATE:   2017-04-28

AUTHOR:    JMichaelTX

  1.  Mac OS X Yosemite 10.10.5+
  2.  Mac Applications
        • Outlook 2011

REF:  The following were used in some way in the writing of this script.
tell application "Microsoft Outlook"
  set msgList to selection
  if msgList = missing value then
    -- no email selected, don't continue
    display dialog "No email is selected!"
  end if
  set oOrigMsg to item 1 of msgList
  set senderName to name of (get oOrigMsg's sender)
  set firstNameStr to word 1 of senderName
  --- CREATE REPLY MSG, But Do NOT Open in Window ---
  set oReplyMsg to reply to oOrigMsg without opening window
  set contentOrigMsg to content of oReplyMsg
  if has html of oReplyMsg then
    set the content of oReplyMsg to ("Hi " & firstNameStr & ",</br>") & contentOrigMsg
    set the plain text content of oReplyMsg to "Hi " & firstNameStr & "," & return & (the plain text content of oReplyMsg)
  end if
  --- NOW OPEN WINDOW, After All Changes Have been set ---
  open oReplyMsg
end tell -- "Microsoft Outlook"


tell application "System Events"
  if quit delay ≠ 0 then set quit delay to 0
  tell application process "Microsoft Outlook"
    set frontmost to true
    tell (first window whose subrole is "AXStandardWindow")
      delay 0.05
      tell scroll area 1 to tell UI element 1 to set focused to true
    end tell
    --- Position Cursor AFTER Salutation ---
    key code 125 -- DownArrow
  end tell
end tell

Even though I'm up to Outlook 2016 (16.14.x), I'm hoping that those KM macros still work and that you can make them available. I'm very interested in ones that change font colors, backgrounds, etc., as I've not figure out an easy way to do that yet.

OK. Give me a day or so, and I'll try to clean them up to be suitable for upload. Feel free to ping me if I don't upload within a few days.

1 Like

Any chance to upload these Macros?
thank you in advance!

1 Like

Hi @JMichaelTX I'm looking into some automation using Outlook 2011 - do you still have these macros? If so I'd be very appreciative if you could upload them!

I was remiss in posting a list of macros that were not ready for public consumption.
Since then I've moved on to Outlook 365, which has a lot in common with 2011, but also many differences.

If you want to pick the top 3 macros you'd like to have, I'll try to get them ready.
But I have to note that I'm very busy at the moment, so it could be days to weeks before I can provide.

If I haven't replied in two weeks feel free to ping me again.

Hey JMichaelTX - thanks for your reply.

After making that post I searched a bit more and found your "Go to Inbox Top Message" and "Copy Email & Paste Into Evernote" macros posted elsewhere and was able to tweak and combine them to achieve what I wanted, which was to automatically reply to the most recent email from a specific person.

Thanks for providing a starting point! Don't worry about the other ones - it was just if you had them handy!

Hi Hi JMichaelTX,

My university in forcing us to start using the MS Outlook app. (I'm on a Mac.) One of its many horrible features is that when you select text and hit REPLY, the quoted text is at the bottom of the message, beneath the signature. Do you happen to have a macro that when replying will place the quoted text at the top of the message (so the reader knows what I'm, talking about when I start my response) and make the font blue? That would be fantastic. Thanks very much.

Nope. I'm happy with the quote being at the bottom of the email.

We moved to MS Exchange and Outlook in Office 365 from another email server. Using Thunderbird is super slow compare to Outlook, but Outlook doesn't have an extremely extremely productive Thunderbird add-on Nostalgy. In Nostalgy, I can go to a folder by typing 'g' and type the folder name, select from the list and hit enter. I made a keyboard shortcut for it in Keyboardmaestro. Similar move/copy message features are present in Nostalgy among others.

I could create copy/move message shortcuts in Keyboardmaestro, but I could not figure out a way to create goto specific folder shortcuts. Please let me know if you are able to figure it out.

Similar while composing the email, I would like to change font and text size, text color and indent text -- the most common operations I do. Again, I was not able to it. Please share if you were able to crack it.

Appreciate your help!


Hi @JMichaelTX,

I'm trying to achieve something similar, but my Applescript fails regularly and only works sometimes. I also use Outlook for Mac (currently v16.58) and would like to be able to create a new message or reply or forward an email and hit my KM shortcut to automatically start the email with Hi <name of person in the To field>. This script tries to achieve that by using UI scripting, but as I said only works sometimes (it seems random). Can you please point me in the right direction? Keep in mind that this script only executes once a reply or New or forward window is open and there is one or more names in the To: field. I use the first name in case of multiple names.

I'd appreciate if you could point me in the right direction - here's an extract of my script:

-- Get the Name and Email Address from the To: field of frontmost email in MS Outlook

if theApp is "Microsoft Outlook" then
   tell application "System Events"
      tell process "Microsoft Outlook"
         set theToRecipient to (value of button 1 of text field 1 of scroll area 1 of splitter group 1 of window 1)
      end tell
   end tell
end if

@Jaco_Muller -

Please be advised of Mr. JMTX's passing last August.

Hey Jaco,

This should be a simple task, but at least for Microsoft Outlook 2016 it's not (as far as I can tell)...

It should be easily possible to add, subtract, or change to-recipients, but my old code for Microsoft Outlook 2011 doesn't work – hence this work-around.

It's tested with Microsoft Outlook 16.16.27 on macOS 10.14.6 and may require adjusting for different versions of Outlook or macOS.

# Auth: Christopher Stone
# dCre: 2015/10/15 17:00
# dMod: 2022/01/12 11:24
# Appl: Microsoft Outlook, System Events
# Task: Set To-Field of front draft window to email address 1 if more than 1.
# Tags: @Applescript, @Script, @Microsoft_Outlook, @System_Events, @KMF
# Test: Tested only with Microsoft Outlook 16.16.27 on macOS 10.14.6.

tell application "Microsoft Outlook"
   if class of front window ≠ draft window then
      error "Front window is not a draft window!"
      tell front draft window
         if its object = missing value then save
         set recipientList to its object's to recipients
         if length of recipientList > 1 then
            set recipientOne to item 1 of recipientList
            set recipientOneEmailAddress to address of (get email address of recipientOne)
         end if
      end tell
   end if
end tell


tell application "System Events"
   if quit delay ≠ 0 then set quit delay to 0
   tell application process "Microsoft Outlook"
      tell (first window whose subrole is "AXStandardWindow")
         tell splitter group 1
            tell (first scroll area whose accessibility description is "To:")
               tell text area 1
                  # set toFieldFocus to its focused
                  set its value to recipientOneEmailAddress
               end tell
            end tell
            # Unnecessary code I left in as an example
            # if toFieldFocus then
            # 	tell (first text field whose accessibility description is "Subject:")
            # 		set its focused to true
            # 	end tell
            # end if
         end tell
      end tell
   end tell
end tell



Thanks Chris,

It turns out that there are quite a few differences between the version of Outlook that you are using and the latest one, so the code simply doesn't get past the "Front window is not a draft window".

Neverthelss through querying UI elements I built it up to the script below, but I miss one final piece: how to get the actual data into a variable.

If I execute the code below, I get the results that I list below the code. How do I get the 'John Doe' part into a variable?

tell application "System Events"
   if quit delay ≠ 0 then set quit delay to 0
   tell application process "Microsoft Outlook"
      set frontmost to true
      tell front window
         tell splitter group 1
            tell scroll area 1
               tell text field 1
                  set uiElems to entire contents
               end tell
            end tell
         end tell
      end tell
   end tell
end tell


{static text "John Doe,, Presence Unknown" of text field 1 of scroll area 1 of splitter group 1 of window "Untitled •" of application process "Microsoft Outlook" of application "System Events"}
set uiElems to entire contents

Instead of the above try:

set myVar to value of static text 1

That works, thank you so much. I didn't add the '1' at the end when I tried.

1 Like

How do I Snooze an email to Later Today using KM10? There are no shortcuts, and can not use the assign keyboard shortcut using MacOS for some reason. Thank you.

Hey Murat,

You're using the desktop version of Outlook?

Outlook from Microsoft Office 2016 on my system has built-in keyboard shortcuts:


And the Select or Show a Menu Item action works fine as well: