Outlook For Mac 2016 Set Applescript To Run

  • I have a Hazel rule that’s watching a folder for any file added today. When it detects a file, it runs the following Applescript: tell application 'Microsoft Outlook' to activate set recipientName to 'Jerry' set recipientAddress to 'email@email.com' set theSubject to 'Kramer's Invoice' set theContent to 'Please find Kramer's invoice attached.
  • Automated inbox cleansing with Outlook 2016 and AppleScript. Handy for catching an unexpected failure or knowing that a run has finished. Inbox based on a programmable set of filters that.

Office 2016 for Mac license. If you choose to upgrade to Microsoft 365 or Office 2019 for Mac, you'll simply need to remove the existing Office 2016 for Mac license, but you won't need to remove your Office apps. Download and run the License Removal Tool. This is very possible with AppleScript. Here's an example with the basics: tell application 'Microsoft Outlook' set theContent to ' set theMessages to messages of folder 'Inbox' of default account repeat with theMessage in theMessages if subject of theMessage contains 'match this string' then set theContent to theContent & plain text content of theMessage end if end repeat set theMessage to. The original Applescript stopped working, so I’ve updated it for you below. Follow the instructions below, and you will be able to integrate Things with the newest versions of Outlook.

-->

Call an AppleScript file from a VB macro in Office 2016 for Mac.

Applies to: Excel for Mac | PowerPoint for Mac | Word for Mac | Office 2016 for Mac

The AppleScriptTask command executes an AppleScript script file located outside the sandboxed app.

The following code shows how to call AppleScriptTask from VB.

The MyAppleScript.applescript file must be in ~/Library/Application Scripts/[bundle id]/. The .applescript extension is not required; you can also use the .scpt extension.

Myapplescripthandler is the name of a script handler in the MyAppleScript.applescript file.

My parameter string is the single input parameter to the myapplescripthandler script handler.

The following are the [bundle id] values for Excel, PowerPoint, and Word:

  • com.microsoft.Word
  • com.microsoft.Excel
  • com.microsoft.Powerpoint

For example, the corresponding AppleScript for Excel would be in a file named MyAppleScriptFile.applescript that is in ~/Library/Application Scripts/com.microsoft.Excel/.

Important

The folders such as com.microsoft.Excel may not exist. In that case, just create them by using a standard mkdir command.

The following is an example of a handler.

What happened to MacScript?

Earlier versions of Office for Mac implemented a command called MacScript that supported inline AppleScripts. Although that command still exists in Office 2016 for Mac, MacScript is deprecated. Due to sandbox restrictions, the MacScript command cannot invoke other applications, such as Finder, in Office 2016 for Mac. We recommend that you use the AppleScriptTask command instead of the MacScript command in apps for Office 2016 for Mac.

Support and feedback

Mac

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.

-->

Use VBA add-ins and macros that you developed for Office for Windows with Office for Mac.

Applies to: Excel for Mac | PowerPoint for Mac | Word for Mac | Office 2016 for Mac

If you are authoring Macros for Office for Mac, you can use most of the same objects that are available in VBA for Office. For information about VBA for Excel, PowerPoint, and Word, see the following:

Note

Outlook for Mac and OneNote for Mac do not support VBA.

Office 2016 for Mac is sandboxed

Unlike other versions of Office apps that support VBA, Office 2016 for Mac apps are sandboxed.

Set

Sandboxing restricts the apps from accessing resources outside the app container. This affects any add-ins or macros that involve file access or communication across processes. You can minimize the effects of sandboxing by using the new commands described in the following section.

Creating an installer or putting user content

For instructions on creating an installer for your add-in, please refer to the article here: Installing User Content in Office 2016 for Mac

New VBA commands for Office 2016 for Mac

The following VBA commands are new and unique to Office 2016 for Mac.

CommandUse to
GrantAccessToMultipleFilesRequest a user's permission to access multiple files at once.
AppleScriptTaskCall external AppleScript scripts from VB.
MAC_OFFICE_VERSIONIFDEF between different Mac Office versions at compile time.

Ribbon customization in Office for Mac

Office 2016 for Mac supports ribbon customization using Ribbon XML. Note that there are some differences in ribbon support in Office 2016 for Mac and Office for Windows.

Ribbon customization featureOffice for WindowsOffice for Mac
Ability to customize the ribbon using Ribbon XMLAvailableAvailable
Support for document based add-insAvailableAvailable
Ability to invoke Macros using custom ribbon controlsAvailableAvailable
Customization of custom menusAvailableAvailable
Ability to include and invoke Office Fluent Controls within a custom ribbon tabAvailableMost familiar Office Fluent Control Identifiers are compatible with Office for Mac. Some might not be available. For commands that are compatible with Office 2016 for Mac, see idMSOs compatible with Office 2016 for Mac.
Support for COM add-ins that use custom ribbon controlsAvailableOffice 2016 for Mac doesn't support third-party COM add-ins.

Outlook For Mac 2016 Set Applescript To Runs

idMSOs compatible with Office 2016 for Mac

Outlook For Mac 2016 Set Applescript To Run

For information about the idMSOs that are compatible with Office 2016 for Mac, see the following:

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.