Using classic Outlook for Windows in business environments
Thank you for posting your question in the Microsoft Q&A forum.
From your description, it seems that Office.onReady works as expected in Outlook Web, but not in Outlook Desktop, even though both Office and Office.onReady are defined. To help narrow down the cause, may I ask:
- Are you using Classic Outlook or the New Outlook experience on Desktop?
- Have you had a chance to test your add-in on both versions?
If you're currently using Classic Outlook, here are a few suggestions that may help with troubleshooting:
Enable Troubleshooting Logging in Classic Outlook
- Open Outlook and go to File > Options
- Navigate to the Advanced tab
- Scroll down to Other
- Check Enable troubleshooting logging (requires restarting Outlook)
Log files will be generated at: %temp%\Outlook Logging
You can access this location by pressing Windows + R, pasting the path, and hitting Enter.
Event-Based Add-ins Consideration
I’m not sure if your add-in is using event-based activation, but I came across a helpful article that highlights some important considerations for Classic Outlook: Configure your Outlook add-in for event-based activation - Office Add-ins | Microsoft Learn
The article mentions that "When the JavaScript function specified in the manifest to handle an event runs, code in Office.onReady() and Office.initialize isn't run. We recommend adding any startup logic needed by event handlers, such as checking the user's Outlook version, to the event handlers instead."
I hope this insight is relevant to your situation and helps clarify why Office.onReady() might not be executing as expected in your case.
Create new profile
Additionally, you may consider creating a new profile in Outlook to rule out the possibility of corruption or misconfiguration in the current profile. Create a new profile following the instructions here: Create an Outlook profile - Microsoft Support
Additional Debugging Resource
I also found an article for debugging add-ins with runtime logging that you may find this helpful: Debug your add-in with runtime logging - Office Add-ins | Microsoft Learn
I hope the information above is useful to you. Please don’t hesitate to come back here if you have any further questions or need additional guidance
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.