AppleScript throws warning message when Macros are disabled via MDM config file - Office 365 apps (Word)

Maju Madhusudanan 6 Reputation points


We have added custom solutions using AppleScript for MS Word for Mac app. This works fine if macros are not disabled. But if user disable the macros using MDM, then the following code fails:

tell application "Microsoft Word"


if not (exists document 1) then //This statement throws a warning dialog,

end if

end tell

Why AppleScript code throws warning message when VBA macros are disabled by administrator? I didnt understand the relation between AppleScript code and macros.

Please find the screenshot of the config file. By default those keys are turned off via config file

Office365 config.png


How do i allow applescript to run? Which key i need to turn it ON to run applescript code? This works fine when i remove the config file from the profiles section.

Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,692 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Crystal-MSFT 45,896 Reputation points Microsoft Vendor

    @Maju Madhusudanan, Thanks for posting in Q&A. Based on my researching, a macro is a series of commands used to automate a repeated task and can be run when you have to perform the task.

    It seems the word you open contain macro. So when you set VisualBasicMacroExexutionState with value DisabledwithWarnings in Intune policy, the warning will come. The issue is not on the script but on the file.

    Hope the above information can help.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.