ExecWB method of WebBrowser control 
Author Message
 ExecWB method of WebBrowser control

 I am writing an application that uses a WebBrowser control to display
pages in which the user can select text anywhere on the page to copy.
I have added a button to the form to allow the user to copy the
selected text to the clipboard and write it to a file for later use.  I
am using the

brwWebBrowser.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT, Null, Null

method to copy the text to the clipboard.  It works fine on some pages
but I get an error on some pages with multiple frames.  The query
status of the edit, copy menu is both enabled and supported but every
time I try to copy text on these types of pages it fails.  I believe it
has to do with cross frame security but I don't know how to get around
it.  I am able to right-click on the text as well as press Ctrl-C to
copy it manually but I would like it to copy the text and write the
clipboard to a file in one step for the user.  I may have to recurse
throught the frames on the page but I don't know how.

Any help would be greatly appreciated.
Chad

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Mon, 01 Apr 2002 03:00:00 GMT  
 ExecWB method of WebBrowser control
I also suspect you are hitting a cross-frame security issue. I guess we must
accept that it is there for good reason; and if we COULD find a way around
it, the whole world would get hit with another MS IE security service pack
!!

I use

    wbr.QueryStatusWB(OLECMDID_COPY) = 3 ' (undefined constant?)

to test. If you send me a URL at which you are hitting this problem, the
least I can do is confirm that I encounter similar behaviour.

Barry Evans
Canberra, Australia
---

I am writing an application that uses a WebBrowser control to display
pages in which the user can select text anywhere on the page to copy.
I have added a button to the form to allow the user to copy the
selected text to the clipboard and write it to a file for later use.  I
am using the

brwWebBrowser.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT, Null, Null

method to copy the text to the clipboard.  It works fine on some pages
but I get an error on some pages with multiple frames.  The query
status of the edit, copy menu is both enabled and supported but every
time I try to copy text on these types of pages it fails.  I believe it
has to do with cross frame security but I don't know how to get around
it.  I am able to right-click on the text as well as press Ctrl-C to
copy it manually but I would like it to copy the text and write the
clipboard to a file in one step for the user.  I may have to recurse
throught the frames on the page but I don't know how.

Any help would be greatly appreciated.
Chad

Sent via Deja.com http://www.deja.com/
Before you buy.



Tue, 02 Apr 2002 03:00:00 GMT  
 ExecWB method of WebBrowser control
Try putting the following in all your pages in the Web app.  It
essentially gets around cross frame security issues.  If you use it in
one page though, you will probably need to put it on all pages.

<script language="VBScript">
<!--
document.domain = "<%=Session("overalldomain")%>"
-->
</script>

Establish the overalldomain variable in a session variable on session
start up.

HTH

Randy


Quote:

>  I am writing an application that uses a WebBrowser control to display
> pages in which the user can select text anywhere on the page to copy.
> I have added a button to the form to allow the user to copy the
> selected text to the clipboard and write it to a file for later use.
I
> am using the

> brwWebBrowser.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT, Null,
Null

> method to copy the text to the clipboard.  It works fine on some pages
> but I get an error on some pages with multiple frames.  The query
> status of the edit, copy menu is both enabled and supported but every
> time I try to copy text on these types of pages it fails.  I believe
it
> has to do with cross frame security but I don't know how to get around
> it.  I am able to right-click on the text as well as press Ctrl-C to
> copy it manually but I would like it to copy the text and write the
> clipboard to a file in one step for the user.  I may have to recurse
> throught the frames on the page but I don't know how.

> Any help would be greatly appreciated.
> Chad

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Sat, 06 Apr 2002 03:00:00 GMT  
 ExecWB method of WebBrowser control
Randy,
  I am using the WebBrowswer control within Visual Basic, not within an
actual web page. Thanks for the reply though.

Chad



Quote:
> Try putting the following in all your pages in the Web app.  It
> essentially gets around cross frame security issues.  If you use it in
> one page though, you will probably need to put it on all pages.

> <script language="VBScript">
> <!--
> document.domain = "<%=Session("overalldomain")%>"
> -->
> </script>

> Establish the overalldomain variable in a session variable on session
> start up.

> HTH

> Randy



> >  I am writing an application that uses a WebBrowser control to
display
> > pages in which the user can select text anywhere on the page to
copy.
> > I have added a button to the form to allow the user to copy the
> > selected text to the clipboard and write it to a file for later use.
> I
> > am using the

> > brwWebBrowser.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT, Null,
> Null

> > method to copy the text to the clipboard.  It works fine on some
pages
> > but I get an error on some pages with multiple frames.  The query
> > status of the edit, copy menu is both enabled and supported but
every
> > time I try to copy text on these types of pages it fails.  I believe
> it
> > has to do with cross frame security but I don't know how to get
around
> > it.  I am able to right-click on the text as well as press Ctrl-C to
> > copy it manually but I would like it to copy the text and write the
> > clipboard to a file in one step for the user.  I may have to recurse
> > throught the frames on the page but I don't know how.

> > Any help would be greatly appreciated.
> > Chad

> > Sent via Deja.com http://www.deja.com/
> > Before you buy.

> Sent via Deja.com http://www.deja.com/
> Before you buy.

Sent via Deja.com http://www.deja.com/
Before you buy.


Sun, 07 Apr 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Help w/ ExecWB method of WebBrowser control

2. ExecWB method for clipboard copy with webbrowser

3. ExecWB and Zoom: Font Size in WebBrowser Control

4. Webbrowser-Control: execwb - Parameter [Pvain] (print templates)

5. Webbrowser-Control: execwb - Parameter [Pvain] (print templates)

6. ExecWB command (WebBrowser control)

7. How to print custom headers with webbrowser.ExecWB using a SafeArray

8. WebBrowser.ExecWB & Print

9. WebBrowser ExecWB and OLECMDID_FIND

10. Unable to use the ExecWB method for PrintPreview

11. How to do .ExecWB() method in vb?

12. How to use the PostData parameter in Navigate2 method of WebBrowser control

 

 
Powered by phpBB® Forum Software