dcsimg
Results 1 to 7 of 7

Thread: ShDocVw Question

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463

    Question ShDocVw Question

    Is there a way to take the document from one instance of ShDocVw and copy it to another ShDocVw control? Its just like assigning a picture from one picturebox to another one.

    I have tried webbrowser1.document = webbrowser2.document and other ways including the innerhtml as well but always get the error of Object Variable or With Block variable not set.

    I don't want to use the Navigate methods - just wondering if I can just copy over the document somehow?

    Thanks

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,092

    Re: ShDocVw Question

    Originally posted by WarrenW
    I have tried webbrowser1.document = webbrowser2.document and other ways including the innerhtml as well but always get the error of Object Variable or With Block variable not set.
    When assigning objects, you need to use the keyword Set. That still may not work, though.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3
    Addicted Member
    Join Date
    Jul 2000
    Location
    FeedMeTown, Ohio
    Posts
    176

    Sorry

    Oops... Just realized You don't want to use Navigate... Though I'm not sure why?

    Not sure if this is what you want...

    webbrowser2.navigate2 "webbrowser1sURL"

    I can't remember off hand... Is this what you're looking for?
    Never tie a rock to your ankle while randomly selecting stones to throw from high places.

  4. #4
    Addicted Member
    Join Date
    Jul 2000
    Location
    FeedMeTown, Ohio
    Posts
    176
    Could always use Webbrowser1.Selectall and Webbrowser1.CopySelected eh?

    This is from memory... Check the Object Browser for the correct syntax.
    Never tie a rock to your ankle while randomly selecting stones to throw from high places.

  5. #5
    Fanatic Member alexandros's Avatar
    Join Date
    Oct 2002
    Location
    Milky Way Galaxy
    Posts
    694
    i hope this helps

    with webbrowser2.document
    .open
    .write webbrowser1.document.documentelement.outerhtml
    .close
    end with
    webbrowser2.refresh

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Oct 2000
    Posts
    1,463
    I just tried the code above and got the same error of Object Variable or With Block variable not set. This happened on the list of .open. Is there something I need to set or a property setting on the browser control first?

    Thanks!

  7. #7
    Fanatic Member alexandros's Avatar
    Join Date
    Oct 2002
    Location
    Milky Way Galaxy
    Posts
    694
    put this before the navigate


    do while not webbrowser1.readystate<>READYSTATECOMPLETE
    doevents
    loop

    i am not sure if it is READYSTATECOMPLETE or READYSTATE_COMPLETE

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width