none
Need help in developing MS Office Add-In on macOS RRS feed

  • Question

  • We are working on macOS application in which we use encryption/decryption for file security. We have similar application available for Windows OS. It has following features,

    • For Office files (Word/Excel/Power Point), there is no visible difference from Explorer view. This means .docx file remains .docx even after encryption.
    • For Office files, there is a button to enable encryption on office application ribbon.
    • This button appears on ribbon because one COM DLL (which is part of Office COM Add-in) from our application gets loaded into Office application executable during its launch.
    • When user clicks on ‘Encrypt’ button, adds data into the file and finally clicks on Save button, this COM DLL communicates with other DLLs from our file encryption application.
    • As a result we are able to complete file encryption process without modifying basic structure of Office applications. Hence Windows explorer is able to identify these files as Office files.

      We want to implement similar functionality into file encryption application for macOS. For this we need inputs on below queries.

      1. Are there any MS Office development APIs available for macOS?
      2. Is it possible to create COM Add-In for Office applications on macOS?
      3. If not, is there any way by which we can create an Office Add-in for macOS?
      4. How we can establish a communication between MS Office application (Word/Excel) and our file encryption application on macOS
    Thursday, June 11, 2020 1:12 PM

All replies

  • If you have add-in that shows UI in a task pane or in a content add-in, you can debug an Office Add-in using Safari Web Inspector.

    To be able to debug Office Add-ins on Mac, you must have Mac OS High Sierra AND Mac Office Version: 16.9.1 (Build 18012504) or later. If you don't have an Office Mac build, you can get one by joining the Office 365 Developer Program.

    To start, open a terminal and set the OfficeWebAddinDeveloperExtras property for the relevant Office application as follows:

    defaults write com.microsoft.Word OfficeWebAddinDeveloperExtras -bool true

    defaults write com.microsoft.Excel OfficeWebAddinDeveloperExtras -bool true

    defaults write com.microsoft.Powerpoint OfficeWebAddinDeveloperExtras -bool true

    defaults write com.microsoft.Outlook OfficeWebAddinDeveloperExtras -bool true

    Then, open the Office application and sideload your add-in. Right-click the add-in and you should see an Inspect Element option in the context menu. Select that option and it will pop the Inspector, where you can set breakpoints and debug your add-in.

     Note

    If you're trying to use the inspector and the dialog flickers, update Office to the latest version. If that doesn't resolve the flickering, try the following workaround:

    Reduce the size of the dialog.
    Choose Inspect Element, which opens in a new window.
    Resize the dialog to its original size.
    Use the inspector as required.
    Thursday, June 11, 2020 2:40 PM
  • Hello,

    > Are there any MS Office development APIs available for macOS?

    You can use AppleScript to automate Office applications. 

    > Is it possible to create COM Add-In for Office applications on macOS?

    Nope. The COM technology exists on Windows only.

    > If not, is there any way by which we can create an Office Add-in for macOS?

    Also you may consider developing a web add-in which also can run on Mac OS. See Office Add-ins platform overview for more information.

    > How we can establish a communication between MS Office application (Word/Excel) and our file encryption application on macOS

    I'd suggest posting this on forums for Mac OS related questions.


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Thursday, June 11, 2020 6:39 PM