Transferring IWebBrowser2 Document Content

Hi all

I have tried this one over and over for 3 days now, so I'm posting this question to the more proficient OLE/COM gurus out there... This isn't overly important, I was just expanding my quest for knowledge and this is something I've come across that I simply can't do.

So, this is what I am trying to do:
I have 2 webbrowser controls on the same form (side by side), both at separate URL locations. I though to myself, "I wonder if you can swap the content of the two webbrowser documents with each other?" so, I decided to give it a go.

If both browsers have HTML documents open, then copying the contents of (IWebBrowser2.Document as IHtmlDocument2) can easily accomplish this task.

However, open up any other OLE document (for example, a powerpoint presentation or PDF document) in one of the browsers and this no longer works as the associated IWebBrowser2.Document is no longer an IHtmlDocument2 interface.

Status: No Good.

Using (IWebBrowser2.Document as IPersistStreamInit).Save and (IWebBrowser2.Document as IPersistStreamInit).Load where IWebBrowser2.Document represents an IHtmlDocument2 interface copies the HTML text only, no images (these need to be reloaded and I don't want to do that, I want EVERYTHING copied).

This also assumes that the separate IWebBrowser2.Document implementations support compatible streaming mechanics. You can't pick up an Acrobat stream and dump it into an IHtmlDocument2 stream.

Status: No Good.

Using (IWebBrowser2.Document as IOleDocumentView).SaveViewState and (IWebBrowser2.Document as IOleDocumentView).ApplyViewState does not transfer document information (not that I could get working anyway).

I don't know whether or not (IWebBrowser2.DefaultInterface as IOleObject).InitFromData is supposed to be used on a new, uninitialized document, but I have 2, already initialized documents and even so, I couldn't get it working properly.

Nope. Looked like it copied info across the webbrowser objects, but certainly didn't visually represent this.

It's obvious I'm trying the wrong things, or the right things in the wrong order. This is just driving me NUTS! Does anyone have any source code capable of copying (or swapping) the contents of one IWebBrowser2 interface to another, regardless of their document content types? I know I could just swap the TWebBrowser controls around on screen, but this defeats the challenge.

Maybe the solution is to get code that physically reparents the OLE controls representing their associated documents between the two IWebBrowser2 (or IWebBrowser2.Container?) interfaces. Even so I haven't had this work either. Can anyone help me?

Cheers fellow COM Challenge folk!