Console log in Javascript Office Addin

When you say you're not using Visual Studio, do you mean that you're not using the Visual Studio template? Or that you physically don't have Visual Studio on the machine (if so, might I recommend you install it -- even just the free/community edition)?

Once you have that:

  • Close all instances of Internet Explorer
  • Go to Visual Studio -> Debug -> Attach to process
  • Be sure to select "Attach to": "Script code"
  • Select all the iexplore.exe instances
  • Click "Attach"

You should now get a full debugging experience, complete with console output ("JavaScript console" window; use the Quick Launch (ctrl-Q) to launch it if it doesn't display be default), DOM Explorer (again, use Quick Launch if you don't see it), and more.

enter image description here

~ Michael Zlatkovsky, developer on Office Extensibility team, MSFT


There is an alt way if you don't have Visual Studio. There is a tool in windows name is 'IEChooser (was F12Chooser)', you can find it at:

  • For the 32-bit version of Office, use C:\Windows\System32\F12\IEChooser.exe
  • For the 64-bit version of Office, use C:\Windows\SysWOW64\F12\IEChooser.exe

More info can be found at: https://docs.microsoft.com/en-us/office/dev/add-ins/testing/debug-add-ins-using-f12-developer-tools-on-windows-10