The documentation for the DocumentComplete event mentions near the end:
In the loading process, the highest level frame, which is not necessarily the top-level frame, fires the final DWebBrowserEvents2::DocumentComplete event. At this time, the pDisp parameter is the same as the IDispatch interface pointer of the highest level frame.
What is the difference between the highest level frame and the top-level frame, and how do I get a reference to the highest level frame?
Assume you have a web site that has a top-level frame set that contains a banner frame on top, a menu frame on the left, and a content frame on the right. Each anchor element in the menu frame has a target attribute set to the content frame. There are some iframes on each content page that would be target pages of menu items.
Now you click a menu link on the left. The frame set itself does not change, nor does the menu frame. The only frame that is navigating is the content frame, the highest level frame in the navigation.
You can get the reference of the highest level navigating frame from the parameter of the first NavigateComplete2 event. IE then parse the frames on the content page to see if there are additional frames to load. Additional NavigateComplete2 and DocumentComplete2 events were raised when the rest of the iframes on the content page are loaded, and finally the DocumentComplete2 event is raised for the content frame.