最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Hot to get a Developer Tools window for the web-based Outlook desktop client? - Stack Overflow

programmeradmin4浏览0评论

Currently I'm developing an small JavaScript add-in for the new web-based desktop version of Microsoft Office Outlook:

Microsoft Outlook version 1.2023.418.200 (Production).
Client version is 20230414002.05.

While I'm able to correctly write a basic add-in (with the help of Yeoman), I fail to debug my add-in or even get a console.log output window.

Since I'm assuming that the new Outlook is based on some kind of hosted Edge WebView and/or Electron, I found no way to actually get the usual Developer Tools.

My assumption is based on the fact that in Process Explorer, the new Outlook is shown as "olk.exe" with several "MsEdgeWebView2.exe" sub-processes:

What I've tried

I've read these other SO articles:

  • Outlook AddIn : How to show console.log with Outlook Desktop?
  • Outlook Office Add-in (Desktop) does not have devtools

I also tried the suggested Microsoft Edge Dev Tools Preview from the Microsoft Store, but unfortunately Outlook does not appear in the list of possible apps to attach to.

I've also spent hours browsing through the Microsoft documentation with no result, too.

And, of course, I tried every Google search I could imagine. Still I found no meaningful results.

In addition, I found the MSDN article "Debug a task pane add-in using Microsoft Edge (Chromium-based) developer tools". I failed to follow this step:

Be sure the add-in's task pane has focus and press Ctrl+Shift+I.

This cannot be done in my scenario, since my add-in has no task pane (I simply try to set the subject of a new email message by calling setAsync on the subject property). In addition, pressing Ctrl+Shift+I has no effect at all, no matter which input field I do focus.

My question

How can I show a debug and/or output window to see the console.log() statements that my JavaScript-based Microsoft Office Outlook add-in (for the web-based desktop version) prints?

Currently I'm developing an small JavaScript add-in for the new web-based desktop version of Microsoft Office Outlook:

Microsoft Outlook version 1.2023.418.200 (Production).
Client version is 20230414002.05.

While I'm able to correctly write a basic add-in (with the help of Yeoman), I fail to debug my add-in or even get a console.log output window.

Since I'm assuming that the new Outlook is based on some kind of hosted Edge WebView and/or Electron, I found no way to actually get the usual Developer Tools.

My assumption is based on the fact that in Process Explorer, the new Outlook is shown as "olk.exe" with several "MsEdgeWebView2.exe" sub-processes:

What I've tried

I've read these other SO articles:

  • Outlook AddIn : How to show console.log with Outlook Desktop?
  • Outlook Office Add-in (Desktop) does not have devtools

I also tried the suggested Microsoft Edge Dev Tools Preview from the Microsoft Store, but unfortunately Outlook does not appear in the list of possible apps to attach to.

I've also spent hours browsing through the Microsoft documentation with no result, too.

And, of course, I tried every Google search I could imagine. Still I found no meaningful results.

In addition, I found the MSDN article "Debug a task pane add-in using Microsoft Edge (Chromium-based) developer tools". I failed to follow this step:

Be sure the add-in's task pane has focus and press Ctrl+Shift+I.

This cannot be done in my scenario, since my add-in has no task pane (I simply try to set the subject of a new email message by calling setAsync on the subject property). In addition, pressing Ctrl+Shift+I has no effect at all, no matter which input field I do focus.

My question

How can I show a debug and/or output window to see the console.log() statements that my JavaScript-based Microsoft Office Outlook add-in (for the web-based desktop version) prints?

Share Improve this question edited Apr 26, 2023 at 5:34 Uwe Keim asked Apr 25, 2023 at 17:55 Uwe KeimUwe Keim 40.8k61 gold badges190 silver badges304 bronze badges 3
  • 1 Hi @Uwe Keim, Are you using LaunchEvents to set the subject in your add-in? If so, you can debug LaunchEvent add-ins via this method: learn.microsoft./en-us/office/dev/add-ins/outlook/… and if that doesn't work, you can add runtime logging using this method: learn.microsoft./en-us/office/dev/add-ins/testing/… – user7823505 Commented Apr 27, 2023 at 22:07
  • Hi @Uwe Keim, you can debug your add-in in the web browser. – Victor Ivanidze Commented May 8, 2023 at 8:44
  • This is an add-in for the local Outlook app, @VictorIvanidze. How could debugging it in the web browser be a realistic scenario? I would have to chance significant portions of my "manifest.xml", e.g. the <DesktopFormFactor> nodes. – Uwe Keim Commented May 8, 2023 at 10:14
Add a ment  | 

2 Answers 2

Reset to default 8

The previous answer doesn't work anymore, today in order to run the DevTools in the New Outlook you should run on the CMD

olk.exe --devtools

Source: Microsoft documentation

EDIT: Update, this no longer works, please see the answer provided by Pahima7 in https://stackoverflow./a/78219863/7312536


I figured it out:

  1. Make sure all Outlook windows are closed
  2. Navigate to %localappdata%\Microsoft\Olk\
  3. Create a file named config.json
  4. Open the file and enter the following:
{
    "edgeDevTools":  "enabled"
}
  1. Save the file, then open Outlook
  2. Press F12 or use any of the other normal shortcut keys to open the dev tools
发布评论

评论列表(0)

  1. 暂无评论