logo
search
Others

How to Open OneDrive from an Outlook Desktop Add-in Using Office.js

Bushra ParveenBushra Parveen Sep 29, 2026 868 views

Question details

Developers want to know how to open or navigate to OneDrive directly from an Outlook Desktop add-in using the Office.js API.

How to Open OneDrive from an Outlook Desktop Add-in Using Office.js
Product
Outlook Add-in (Office.js)
Device & OS
not provided
Scenario
Creating an Outlook desktop add-in and attempting to switch the navigation interface to OneDrive or open OneDrive modules.
Observed behavior
Office.js does not provide an API for switching Outlook desktop modules or opening OneDrive directly inside the Outlook navigation rail.
Before you start

Ensure you have the latest version of the Office JavaScript API (Office.js) and active credentials if you plan to use the Microsoft Graph API as a workaround.

Solution 1Recommended

Use displayDialogAsync to Open OneDrive in a Dialog or Browser

Since direct navigation within the Outlook client is unsupported, use the Dialog API to open the OneDrive web interface in a separate window.

The Office JavaScript API restricts add-ins from changing the main Outlook desktop navigation modules. However, you can utilize the Dialog API to securely authenticate and display external web content, such as OneDrive.

1
Initialize the Dialog API

In your add-in's JavaScript code, prepare the URL for the OneDrive web interface or your custom OneDrive file picker.

2
Call displayDialogAsync

Execute Office.context.ui.displayDialogAsync('https://onedrive.live.com', {height: 50, width: 50}, function (asyncResult) { ... }); to trigger the popup.

3
Handle Dialog Events

Set up a callback function to handle messages or events from the dialog box, allowing your add-in to know when the user has finished interacting with OneDrive.

Use displayDialogAsync to Open OneDrive in a Dialog or Browser
Navigation Limitation: This method opens OneDrive in a dialog box or default browser, not directly within the Outlook desktop module rail.
Free Microsoft Office alternative

Looking for a Flexible and Developer-Friendly Office Suite?

If you are encountering platform limitations with Microsoft Office add-ins, consider exploring WPS Office. It provides a lightweight, highly compatible alternative with excellent support for document automation and existing Microsoft file formats.

  1. 1. Download WPS Office: Visit the official WPS website and download the free installer for your operating system.
  2. 2. Install the Software: Run the installer and follow the quick setup instructions to integrate WPS onto your desktop.
  3. 3. Open Your Documents: Launch WPS Office and instantly open your existing Microsoft Word, Excel, and PowerPoint files without formatting loss.
Fully compatible with Microsoft Office formats (DOCX, XLSX, PPTX)Lightweight installation with blazing fast performanceFamiliar user interface for seamless migration without a learning curveRobust developer tools and macro support for automated workflows
microsoft office alternative - wps office

Frequently Asked Questions

Can I switch Outlook desktop modules directly using Office.js?

No, currently the Office JavaScript API (Office.js) does not provide any methods to switch between Outlook desktop modules (like moving from Mail to Calendar or OneDrive) directly within the navigation interface.

Does displayDialogAsync open OneDrive inside the Outlook window?

The displayDialogAsync method opens a separate dialog box or launches the user's default web browser. It does not embed the OneDrive interface natively within the main Outlook client window.

Where can I request new API features for Outlook add-ins?

You can submit feature requests, report bugs, or discuss API limitations directly with the development team on the official GitHub repository at github.com/OfficeDev/office-js/issues.