Results 1 to 30 of 30

Thread: Web Page

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    how do you get a web page into a vb form? I am not looking for just the picture. I want the actual page to be in the form, like my own browser.

    Thanx
    Mako Shark
    Great White

  2. #2
    Guest
    Use the Webbrowser Control (ShDocVw.dll) which is a part of IE. It is located in the Custom Controls (Ctrl+T) under Microsoft Internet Controls.

    Commands mostly used:

    Code:
    'Go to the previous webpage
    WebBrowser1.GoBack
    'Go to the present webpage
    WebBrowser1.GoForward
    'Go to the default IE home
    WebBrowser1.GoHome
    'Go to the default search page
    WebBrowser1.GoSearch
    'Refresh the current webpage
    WebBrowser1.Refresh
    'Navigate to a webpage
    WebBrowser1.Navigate "www.vb-world.net"

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    Thanx for the quick response. also, I posted this yesterday. Do you know how to login with an x id. I am on a t1 line.
    Mako Shark
    Great White

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    Matthrew, what you posted on the Microsoft Inet Control will make a new instance of IE. I was wondering if you know a way to view that right on one of my child form?
    Mako Shark
    Great White

  5. #5
    Guest
    Wow, I did respond quick, didn't even realize it.

    Here is the thread that shows what you want to do.

    And I'm not sure how to log on to an x id..whatever that is .

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    Sorry for being slow, but I am still lost with your example.

    There are two controls under that dll. what is the ShellFileViewOC?
    Mako Shark
    Great White

  7. #7
    Guest
    Did you accidently go to References? To do it manually, click on Browse or whatever is there to select a ocx file, and located in the C:\Windows\System directory with a file called ShDocVw.dll. You are talking about the Custom Controls, aren't you? There should be one named Microsoft Internet Controls.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    I did what you told to do. control T. when I checked on it, there are two controls that appears. the browsers and the ShellFolderViewOC.

    I pasted your codes on too the form, but still nothing appears.

    Thanx for helping Mattrew.


    Private Sub Form_Click()
    Dim ppDisp As Object
    Dim F As New Form1
    Set ppDisp = F.WebBrowser1.object
    F.Show
    End Sub
    Mako Shark
    Great White

  9. #9
    Guest
    When you went into Custom Controls (Ctrl+T), did you do the other alternative: click on Browser... and select C:\Windows\System\ShDocVw.dll ? After you select it, it should automatically put it in the list and go to it, than you just make sure it's checked and click OK.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    Sorry if I am confusing you. I got the control on my form already. It has an icon of the earth. I dropped the control on my form but still don't see any http://www.yahoo.com on my form. again, i don't have trouble locating the control, but why isn't the webbrowser control displaying the yahoo site?
    Mako Shark
    Great White

  11. #11

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247

    Thumbs up

    thanx for your help. I got it working now. I pasted the code above into it. thanx again Matthrew.
    Mako Shark
    Great White

  12. #12
    Guest

    Curious:

    Did you forget to navigate to the site?

    Code:
    Private Sub Form_Load()
    Webbrowser1.Navigate "http://www.yahoo.com"
    End Sub

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247

    Talking You guess right!

    Thanx you!
    Mako Shark
    Great White

  14. #14

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    How can I view the addressbar? I set it to true already but it is not visible.


    I ask you this earlier about x id. It is another name for the network id. at my company, to login to the internet, I have to enter the network id. do you know how to enter it through codes?

    Thanx

    [Edited by Shark on 10-06-2000 at 01:06 AM]
    Mako Shark
    Great White

  15. #15
    Guest
    I don't think the address bar would show and I have no idea why. Make your own.

    Code:
    Private Sub Command1_Click()
    Webbrowser1.Navigate Combo1.text
    End Sub
    And if you want to have a status bar:

    Code:
    Private Sub WebBrowser1_StatusTextChange(ByVal Text As String)
    Label1.Caption = Text
    End Sub
    For the x id, I think you have to do it yourself..unless you use SendKeys to do it.

    And if you need help with anything else for the Webbrowser Control, just ask.

  16. #16

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    You are great. Make others people lifes come easier. Thanx so much!
    Mako Shark
    Great White

  17. #17

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    OK, I thought of a question for you. I got this code from you. you posted for someone somewhere.

    webbrowser1.execwb savecopyas, donotprompt

    How come it still prompt me when I wanted to save a jpeg?
    Mako Shark
    Great White

  18. #18
    Guest
    Webbrowser Control is just like that. It always prompts you for stuff. If you look in the Object Browser at the Webbrowser Control, you will see many things in it. Some of those things work...and some don't. It gives you an error when you try to do certain things. Even if you download IE 5.5, it still does it. I guess Microsoft can't work out every bug(s) . I guess your going to have to...

    Live it, learn it, love it.
    By the way, are you wanting to save everything on the Web page? Here is how you do it:

    Code:
    WebBrowser1.ExecWB OLECMDID_SAVEAS,OLECMDEXECOPT_PROMPTUSER
    Notice: If you switch PROMPTUSER to DONTPROMPTUSER, it does not work. The user must choose where it is to be saved.

  19. #19

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    Thanks Matthrew. I just thought of an idea. I am using IE5 on Win2k. When you load a picture or a file, it has to cache out to somewhere. So, instead of using Webbrowser1.Execwb, why not just copy it from the cache? This way the save dialog box can be avoid. Only problem is where does it cache out the file? Have any ideas?
    Mako Shark
    Great White

  20. #20
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715
    The folder where it's cached is "C:\WINDOWS\Temporary Internet Files"
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  21. #21

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247

    Thanks for the reply Oetje

    That might be on win9x but not on win2k.


    I have two more questions Matthrew.

    Web.Document.Forms(0).login.Value


    What else can I do with Document and why is Forms(0) but not Forms(1222). What does the zero represent?


    Thanks
    Mako Shark
    Great White

  22. #22
    Fanatic Member
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    715

    Re: Thanks for the reply Oetje

    Originally posted by Shark
    Why is Forms(0) but not Forms(1222). What does the zero represent?
    If you ever studied html, then you know the <form> tag. A form is a piece in an html that contains controls. Controls like command buttons, text buttons, etc. Forms(0) means the first form in the web page.
    Oetje
    [email protected]
    93606776
    Visual Basic 6, Windows 2000

    Never pet a burning dog

  23. #23

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247

    thanks oetje - i see now

    This is for Matthrew.

    Matthrew. I just thought of an idea. I am using IE5 on Win2k. When you load a picture or a file, it has to cache out to somewhere. So, instead of using Webbrowser1.Execwb, why not just copy it from the cache? This way the save dialog box can be avoid. Only problem is where does it cache out the file? Have any ideas?
    Mako Shark
    Great White

  24. #24
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    You might want to check this site out.

    http://support.microsoft.com/support.../Q244/7/57.ASP
    Chemically Formulated As:
    Dr. Nitro

  25. #25

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    Thanks Nitro.

    While looking at that site, I stumble into URLDownloadToCacheFile. Can you show me how to use that too.
    Mako Shark
    Great White

  26. #26
    New Member
    Join Date
    Oct 2000
    Location
    India
    Posts
    3

    Talking

    Hey shark ,
    no need to use the web browser control.
    insert a module declare this api call ...

    Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

    Public Declare Function GetActiveWindow Lib "user32" () As Long


    then ...
    Private Sub mnuGotoURL_Click()
    surl = "http://www.vb-world.net"
    ShellExecute GetActiveWindow(), "Open", surl, "", 0&, 1
    End Sub

    hope this solves ya prob ....
    later ....



  27. #27

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247

    Thanks so much for your reply ActiveX

    Thanks but I don't want to open a new IE browser because I need the end user to browse in the form of my project.

    Using the ShellExecute will launch a new instance.
    Mako Shark
    Great White

  28. #28
    Guest
    Originally posted by Shark
    Thanks Nitro.

    While looking at that site, I stumble into URLDownloadToCacheFile. Can you show me how to use that too.
    There is an example right on Vb-World.net for how to use the URLDownloadToFile function.

  29. #29

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    Thanks Matthrew but I am looking how to use URLDownloadToCacheFile not URLDownloadToFile.
    Mako Shark
    Great White

  30. #30

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    247
    The site that nitro provided talks little about it, but provide no sytax for the api.

    Thanks for looking.
    Mako Shark
    Great White

Posting Permissions

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



Click Here to Expand Forum to Full Width