Copy contents of Browser Control to Microsoft Word
Hello,
In a VB.NET windows application, I am attempting to copy the contents of an AxBrowswer window to a word.application document. Does anyone know how to do this?
I have the following, but it doesn't work:
wrdApp2 = CreateObject("Word.Application")
wrdApp2.Documents.Open("C:\Test1.doc")
AxWebBrowser1.Select()
Clipboard.SetDataObject(AxWebBrowser1)
wrdApp2.Documents.paste(Clipboard.GetDataObject)
wrdApp2.Documents.Save()
Overall
I am able to copy one word document to another and open a word document in a WebBrowser for editing. Know I need to know how to copy the contents of a browser to a word document. My ultimate goal is to put xml data tables into MS Word (not supported in Office 2000 without building some sort of parser).
Scenario is:
1. User enters data into Dataset. (Complete)
2. Program Saves as xml. (Complete)
3. Opening in web browser using html + xsl style. (Complete)
4. copy to microsoft word document. (I'm stuck)
Thanks for all your help.
:)
Select and Copy contents of axbrowser control (Ctrl+A, then Ctrl+C)
Thanks Lee. I think you got me one step closer. I was able to paste the contents of the clipboard using your command.
Now all I need to know is how to Copy the contents from the web browser control such that it is in a format that can be pasted into word. Currently the format I copy from the WebBrowser is not valid for wrdapp.selection.paste. (Either that, or I am not copying the value at all).
Essentially, now I just need to perform a select all (CTRL+A) and then copy (CTRL+C).
Anyone that can help would be greatly appreciated!