When a Word document takes several seconds to open, troubleshooting the delay can be difficult because Word does not show what is happening internally. You can use Visual Studio Event Tracing for Windows diagnostics to capture a timeline of every operation Word performs during document loading. This article explains how to set up an ETW profiling session in Visual Studio, attach it to Word, and interpret the trace data to identify the bottleneck. By the end, you will be able to pinpoint which add-in, feature, or resource is causing the slow load.
Key Takeaways: Profiling Word Document Loading With ETW in Visual Studio
- Visual Studio Performance Profiler > ETW Provider > Microsoft-Windows-Word-Application: Captures a detailed event trace of Word startup and document loading.
- Diagnostics Hub in Visual Studio 2022: The tool to start, stop, and save a profiling session without modifying Word.
- CPU Usage + Events Timeline: The two main views used to correlate slow operations with specific Word events such as AddInLoad or DocumentOpen.
How ETW Diagnostics Works With Word
Event Tracing for Windows is a kernel-level logging system built into Windows. Visual Studio can consume ETW events from any application that registers event providers. Word registers the provider Microsoft-Windows-Word-Application during its startup. When you enable this provider in the Visual Studio Performance Profiler, every significant operation Word performs — such as loading add-ins, parsing document XML, rendering pages, or fetching linked content — is recorded as an event with a timestamp and duration.
Before you begin, make sure you have Visual Studio 2022 or later installed on the same machine where Word runs. You do not need the Word source code or symbols. The profiling session works with any retail version of Word for Microsoft 365 or Word 2021. You also need administrator rights on the machine to start an ETW session.
Steps to Profile Word Document Loading
- Close all Word instances
Make sure no Word process is running. Open Task Manager and end any WINWORD.EXE process to ensure a clean baseline. - Open Visual Studio and start the Performance Profiler
In Visual Studio, go to Debug > Performance Profiler or press Alt+F2. The Diagnostics Hub opens. - Select the ETW provider for Word
In the Performance Profiler window, click Change Target and choose Startup Application. Browse to the Word executable (usually C:\Program Files\Microsoft Office\root\Office16\WINWORD.EXE). Then click Deselect all and enable only CPU Usage and ETW Provider. Click the gear icon next to ETW Provider, add Microsoft-Windows-Word-Application, and set the trace level to Verbose. - Configure the document to load
Still in the ETW Provider settings, under Command Line Arguments, enter the full path to the slow document in quotes. For example: “C:\Users\YourName\Documents\SlowReport.docx”. This forces Word to load that file immediately after startup. - Start the profiling session
Click Start. Visual Studio launches Word, which then opens the specified document. Wait until the document is fully loaded and rendered. Do not interact with Word until the load completes. - Stop the profiling session
After the document is open, switch back to Visual Studio and click Stop Collection. The diagnostic session closes and a .diagsession file is saved automatically. - Analyze the timeline and events
In the Diagnostics Hub, the CPU Usage tab shows a timeline of CPU activity. Switch to the Events tab. You see a list of ETW events from Word. Look for events with the task name DocumentOpen, AddInLoad, FileRead, or Rendering. Sort by Duration descending to find the slowest operation. - Identify the bottleneck
Double-click a long-duration event. The details pane shows the event payload, including the add-in name or file path involved. For example, an AddInLoad event with a duration of 8000 ms indicates a slow COM add-in. A FileRead event with a large I/O size points to a large embedded image or OLE object.
Common Issues When Profiling Word With ETW
No Word Events Appear in the Events Tab
If the Events tab is empty, the ETW provider was not enabled correctly. Go back to the ETW Provider settings and verify that Microsoft-Windows-Word-Application is listed and the trace level is Verbose. Also confirm that you launched Word from the Performance Profiler, not manually. If you manually started Word, the ETW provider will not attach.
Profiling Session Fails to Start
This usually happens when another ETW session is already running. Open a command prompt as administrator and run logman stop -ets to stop all active ETW sessions. Then retry the profiling session in Visual Studio.
Document Opens Too Quickly to Capture
If the document loads in under two seconds, the ETW events may be too short to appear in the default view. In the Events tab, click the Filter button and set the minimum duration to 0 ms. Then sort by timestamp to see all events. Alternatively, load a much larger document with many pages, images, or tracked changes to produce longer events.
Visual Studio ETW Profiling vs Built-In Word Diagnostic Tools
| Item | Visual Studio ETW Profiling | Word Safe Mode / Event Viewer |
|---|---|---|
| Granularity | Event-level detail with sub-millisecond timestamps | Only high-level error codes or generic slow events |
| Add-in identification | Shows exact add-in name and load duration | Requires manual disabling one by one |
| Performance overhead | Minimal (under 5% CPU impact) | No overhead but no timeline data |
| Setup complexity | Requires Visual Studio and admin rights | No extra tools needed |
| Best for | Deep analysis of slow document loading, add-in conflicts, or rendering delays | Quick check for corrupt templates or basic startup issues |
Visual Studio ETW profiling gives you the exact sequence and duration of every operation during document loading. Word safe mode or Event Viewer only reports that something went wrong, not what caused it. Use ETW when you need to prove which component is slow.
You can now profile any Word document loading issue using Visual Studio ETW diagnostics. The event timeline shows exactly which add-in, file read, or rendering operation takes the longest. After identifying the bottleneck, disable the offending add-in or reduce the document size. For repeated profiling, save the .diagsession file and compare traces between a fast and a slow document to isolate the difference. To extend this technique, enable the Microsoft-Windows-Word-Application provider on a remote machine using Visual Studio Remote Debugger to profile Word on a user’s computer without installing Visual Studio locally.