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

Maju Madhusudanan 6 Reputation points
2024-06-15T16:21:00.9166667+00:00

Hi,

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"

activate

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

warning.jpg

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,583 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Crystal-MSFT 45,011 Reputation points Microsoft Vendor
    2024-06-17T02:28:14.5133333+00:00

    @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.

    https://support.microsoft.com/en-us/office/enable-or-disable-macros-in-microsoft-365-files-12b036fd-d140-4e74-b45e-16fed1a7e5c6

    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.