Hi All,
I use the Microsoft webbrowser component (com component) to preview .pdf .doc .xls and .txt docs. Users can select a document with a combobox and then I let the webbrowser navigate to the chosen document with the following code:
AxWebBrowser.Navigate2("selectecdocument.doc")
This works fine but after that the document has been loaded in the webbrowser control, the cursor ends up in the document that has been loaded. For example when loading a word doc the cursor ends up within the word document and when the user types something he/she is changing the document.
I want to prevent users from editing the document and therefore I need to move the cursor out of the word document after the document has been loaded. However, things like this (after the navigate2 command):
me.focus
or
nameofanycontrolontheform.focus
don't work. I guess this is because the focus is set to a different application (in my example ms word) after the document has been loaded. Would there be any way to place the cursor back anywhere on my form (outside the webbrowser control) and thus switch back to my own application??
I use the Microsoft webbrowser component (com component) to preview .pdf .doc .xls and .txt docs. Users can select a document with a combobox and then I let the webbrowser navigate to the chosen document with the following code:
AxWebBrowser.Navigate2("selectecdocument.doc")
This works fine but after that the document has been loaded in the webbrowser control, the cursor ends up in the document that has been loaded. For example when loading a word doc the cursor ends up within the word document and when the user types something he/she is changing the document.
I want to prevent users from editing the document and therefore I need to move the cursor out of the word document after the document has been loaded. However, things like this (after the navigate2 command):
me.focus
or
nameofanycontrolontheform.focus
don't work. I guess this is because the focus is set to a different application (in my example ms word) after the document has been loaded. Would there be any way to place the cursor back anywhere on my form (outside the webbrowser control) and thus switch back to my own application??