If your add-in has an add-in command that executes a function, the function runs in a hidden browser process that the F12 tools cannot detect or attach to, so the technique described in this article cannot be used to debug code in the function. The following steps are the instructions for debugging your add-in. If you just want to test the F12 tools themselves, see Example add-in to test the F12 tools. Launch the F12 development tools that corresponds to your version of Office. 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.IEChooser opens with a window named Choose target to debug. Your add-in will appear in the window named by the filename of the add-in's home page. In the following screenshot, it is Home.html. Only processes that are running in Internet Explorer, or Trident, appear. The tool cannot attach to processes that are running in other browsers or webviews, including Microsoft Edge. Select your add-in's process that is, its home page file name. This action will attach the F12 tools to the process and open the main F12 user interface. This message appears when you start profiling script code, but AQTime cannot find the required version of the Microsoft Script Debugger on your computer. In the upper left of the tab, just below the debugger tool ribbon, there is a small folder icon. Select this to open a drop down list of the files in the add-in. Select the file that you want to debug and it opens in the the script (left) pane of the Debugger tab. If you're using a transpiler, bundler, or minifier, that changes the name of the file, it will have the final name that is actually loaded, not the original source file name. Scroll to a line where you want to set a breakpoint and click in the margin to the left of the line number. You'll see a red dot to the left of the line and a corresponding line appears in the Breakpoints tab of the bottom right pane. The following screenshot is an example.Įxecute functions in the add-in as needed to trigger the breakpoint. When the breakpoint is hit, a right-pointing arrow appears on the red dot of the breakpoint. The following screenshot is an example.įor more information about using the F12 tools, see Inspect running JavaScript with the Debugger. This example uses Word and a free add-in from AppSource. In the Debugger tab, open the file Home.js as described in the preceding section.Launch the F12 development tools that corresponds to your version of Office as described in the preceding section.On the Insert tab, in the Add-ins group, select My Add-ins to open the Office Add-ins dialog and then select the STORE tab. In the add-in, select the Insert button.Set the breakpoints on lines 310 and 312. Open the dialog and then select the Refresh button in the tools.If your add-in uses the Office Dialog API, the dialog runs in a separate process from the task pane (if any) and the tools must attach to that process.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |