VB6 - WebBrowser Control - about:blank Hyperlinks - basic.visual

This is a discussion on VB6 - WebBrowser Control - about:blank Hyperlinks - basic.visual ; OK I've been searching for an answer for days and keep coming up blank. No pun intended. I'll try not to be winded but I'm very puzzled, almost meltdown time! I'm generating a dynamic web page with several links in ...

+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

VB6 - WebBrowser Control - about:blank Hyperlinks

  1. Default VB6 - WebBrowser Control - about:blank Hyperlinks

    OK I've been searching for an answer for days and keep coming up blank. No
    pun intended.
    I'll try not to be winded but I'm very puzzled, almost meltdown time!

    I'm generating a dynamic web page with several links in a WebBrowser Control
    by pulling information about books from a database. The hyperlinks that are
    created should link to "static" web pages that are in a subfolder (html) of
    my project. When I click on any of those hyperlinks all I get is a white
    page with the text of the linked page prefixed by the word "blank"
    EX: blankhtml/Books/1/18.htm

    If I view the source of the web page before I click on the link, the html
    source code for the link looks fine:
    EX: <a href="html/Books/1/18.htm">Read Full Chapter</a>

    My code which generates the hyperlink looks like this:
    Web1.MoveFirst
    While Not Web1.EOF
    HTMLText = HTMLText & "<font face=Verdana size=1><a
    href=""html/Books/" & Web1.Fields("BookNum").Value & "/" &
    Web1.Fields("Chapter").Value & ".htm"">Read Full Chapter</a></FONT><BR><BR>"
    Web1.MoveNext
    Wend

    Now, If I replace my dynamically created hyperlink with a static web site as
    shown below everything works fine.
    Web1.MoveFirst
    While Not Web1.EOF
    HTMLText = HTMLText & "<font face=Verdana size=1><a
    href="http://www.msn.com">Read Full Chapter</a></FONT><BR><BR>"
    Web1.MoveNext
    Wend

    So I'm lost. If any of this sounds familiar to you PLEASE point me in the
    right direction?

    Thanks!
    Bill



  2. Default Re: VB6 - WebBrowser Control - about:blank Hyperlinks

    "Bill Kearns" <bkearns@nospam.com> wrote in message
    news:GUcNb.7200$q4.6004@newsread3.news.atl.earthlink.net...
    > OK I've been searching for an answer for days and keep coming up blank. No
    > pun intended.
    > I'll try not to be winded but I'm very puzzled, almost meltdown time!
    >
    > I'm generating a dynamic web page with several links in a WebBrowser

    Control
    > by pulling information about books from a database. The hyperlinks that

    are
    > created should link to "static" web pages that are in a subfolder (html)

    of
    > my project. When I click on any of those hyperlinks all I get is a white
    > page with the text of the linked page prefixed by the word "blank"
    > EX: blankhtml/Books/1/18.htm
    >
    > If I view the source of the web page before I click on the link, the html
    > source code for the link looks fine:
    > EX: <a href="html/Books/1/18.htm">Read Full Chapter</a>
    >
    > My code which generates the hyperlink looks like this:
    > Web1.MoveFirst
    > While Not Web1.EOF
    > HTMLText = HTMLText & "<font face=Verdana size=1><a
    > href=""html/Books/" & Web1.Fields("BookNum").Value & "/" &
    > Web1.Fields("Chapter").Value & ".htm"">Read Full

    Chapter</a></FONT><BR><BR>"
    > Web1.MoveNext
    > Wend
    >
    > Now, If I replace my dynamically created hyperlink with a static web site

    as
    > shown below everything works fine.
    > Web1.MoveFirst
    > While Not Web1.EOF
    > HTMLText = HTMLText & "<font face=Verdana size=1><a
    > href="http://www.msn.com">Read Full Chapter</a></FONT><BR><BR>"
    > Web1.MoveNext
    > Wend
    >
    > So I'm lost. If any of this sounds familiar to you PLEASE point me in the
    > right direction?
    >
    > Thanks!
    > Bill
    >
    >


    prefice your links with: file://app.path/
    EX: <a href="file://app.path/html/Books/1/18.htm">Read Full Chapter</a>

    dont use the words literaly app.path repalce that with the path to the
    files, but DO use: file://


    --
    Mike Bradley
    http://www.gzentools.com -- free online php tools



  3. Default Re: VB6 - WebBrowser Control - about:blank Hyperlinks

    I think the problem is that you're linking to a relative
    URL from a page with no Location path. The WB does
    not reside in App.Path and has no knowledge of it.

    You can make the links in File:\\\ format. I think that
    will work. Or you can save your page to the parent folder
    of the "html" folder and then reload it with WB.Navigate.

    The second method would result in a page in your WB
    with a Location path of App.Path so that your relative
    URL would then represent a valid one, like:
    App.Path/html/Books/

    --
    --
    Bill Kearns <bkearns@nospam.com> wrote in message
    news:GUcNb.7200$q4.6004@newsread3.news.atl.earthlink.net...
    > OK I've been searching for an answer for days and keep coming up blank. No
    > pun intended.
    > I'll try not to be winded but I'm very puzzled, almost meltdown time!
    >
    > I'm generating a dynamic web page with several links in a WebBrowser

    Control
    > by pulling information about books from a database. The hyperlinks that

    are
    > created should link to "static" web pages that are in a subfolder (html)

    of
    > my project. When I click on any of those hyperlinks all I get is a white
    > page with the text of the linked page prefixed by the word "blank"
    > EX: blankhtml/Books/1/18.htm
    >
    > If I view the source of the web page before I click on the link, the html
    > source code for the link looks fine:
    > EX: <a href="html/Books/1/18.htm">Read Full Chapter</a>
    >
    > My code which generates the hyperlink looks like this:
    > Web1.MoveFirst
    > While Not Web1.EOF
    > HTMLText = HTMLText & "<font face=Verdana size=1><a
    > href=""html/Books/" & Web1.Fields("BookNum").Value & "/" &
    > Web1.Fields("Chapter").Value & ".htm"">Read Full

    Chapter</a></FONT><BR><BR>"
    > Web1.MoveNext
    > Wend
    >
    > Now, If I replace my dynamically created hyperlink with a static web site

    as
    > shown below everything works fine.
    > Web1.MoveFirst
    > While Not Web1.EOF
    > HTMLText = HTMLText & "<font face=Verdana size=1><a
    > href="http://www.msn.com">Read Full Chapter</a></FONT><BR><BR>"
    > Web1.MoveNext
    > Wend
    >
    > So I'm lost. If any of this sounds familiar to you PLEASE point me in the
    > right direction?
    >
    > Thanks!
    > Bill
    >
    >




  4. Default Re: VB6 - WebBrowser Control - about:blank Hyperlinks

    Thank you both but still not working with App.Path which I had already
    tried. or file:\\\. I even tried reversing all the delimeters throughout the
    path name as in file:/// still nada. The I was thinking it may have to do
    with spaces in the directory names like "Program Files", so I replaced all
    spaces with "%20", still no good. I hate to think this can't be done because
    it will sure pull down allot of barriers if I can get it to work! Complete
    Sub code is below, if anyone would like to look at the vb files just e-mail
    me and I'll zip them up. bkearns(a)goodnewsinteractive.com

    Private Sub CommandGo_Click()

    On Error Resume Next
    Dim SQLWeb1 As String, SearchTxt As String, TransTxt As String, Web1 As
    Recordset

    Screen.MousePointer = vbHourglass
    SearchTxt = SearchText.Text
    TransTxt = TranslationText.Text
    'BookTxt = BookText.Text

    Dim SearchPic As String
    SearchPic = App.Path & "\search_results.gif"

    Dim SQLFixup
    SQLFixup = Replace(SearchTxt, "'", "''")

    SQLWeb1 = "SELECT * FROM Comp_Books WHERE Text LIKE '%" & SQLFixup & "%'
    ORDER BY BookNum;"
    Set Web1 = New Recordset
    Web1.Open SQLWeb1, db, adOpenStatic, adLockReadOnly

    Dim URL As Variant
    Dim HTMLText As String
    Dim sURL As String
    sURL = App.Path & "\html\Books\" & Web1.Fields("BookNum").Value & "/" &
    Web1.Fields("Chapter").Value & ".htm"
    Dim fixURL
    fixURL = Replace(sURL, " ", "%20")
    Dim fixURL2
    fixURL2 = Replace(fixURL, "\", "/")
    Dim doc As MSHTML.HTMLDocument

    Set doc = WebBrowser1.Document
    doc.body.innerHTML = HTMLText

    HTMLText = "<HTML><BODY BGCOLOR=#FFFFFF topmargin=0 leftmargin=0
    MARGINWIDTH=0 MARGINHEIGHT=0 >"
    HTMLText = HTMLText & "<style>"
    HTMLText = HTMLText & "<!--"
    HTMLText = HTMLText & ".1 { font-family: ""Verdana""; font-size: 8pt;
    color: #000000 }"
    HTMLText = HTMLText & ".2 { font-family: ""Verdana""; font-size: 8pt;
    color: #000000; background-color: #FFFF00 }"
    HTMLText = HTMLText & ".3 { font-family: ""Verdana""; font-size: 8pt;
    color: #0000FF }"
    HTMLText = HTMLText & ".4 { font-family: ""Verdana""; font-size: 8pt;
    color: #C0C0C0 }"
    HTMLText = HTMLText & "-->"
    HTMLText = HTMLText & "</style>"
    HTMLText = HTMLText & "<table border=0 cellspacing=1 width=575
    cellpadding=3>"
    HTMLText = HTMLText & "<tr>"
    HTMLText = HTMLText & "<td width=100%>"
    HTMLText = HTMLText & "<img border=0 src='" & SearchPic & "'
    align=absmiddle width=36 height=36><font face=Arial size=2
    color=#000000><B><I>&nbsp;Search Results for """ & SQLFixup &
    """</I></b></Font><br>"
    HTMLText = HTMLText & "<P align=justify>"
    Web1.MoveFirst
    While Not Web1.EOF
    HTMLText = HTMLText & "<font face=Verdana color=0000FF size=1>" &
    Web1.Fields("Book").Value & "&nbsp;" & Web1.Fields("ChapVerse").Value &
    "</FONT><BR>"
    HTMLText = HTMLText & "<font face=Verdana color=000000 size=1>" &
    Web1.Fields("Text").Value & "&nbsp;</FONT><BR>"
    HTMLText = HTMLText & "<font face=Verdana size=1><a href=""file:///"
    & "" & fixURL2 & """>Read Full Chapter</a></FONT><BR><BR>"
    Web1.MoveNext
    Wend

    HTMLText = HTMLText & "</td>"
    HTMLText = HTMLText & "</tr>"
    HTMLText = HTMLText & "</table>"
    HTMLText = HTMLText & "</BODY></HTML>"
    WebBrowser1.Document.Script.Document.Clear
    WebBrowser1.Document.Script.Document.Write HTMLText
    WebBrowser1.Document.Script.Document.Close

    Label1.Caption = TranslationCombo.Text
    Screen.MousePointer = vbDefault

    End Sub



  5. Default Re: VB6 - WebBrowser Control - about:blank Hyperlinks

    I would have thought that that would work.
    In any case, you can still do it the other way:
    Just save the HTML as app.path\newdoc.html
    then use:
    WebBrowser1.Navigate App.Path & "\newdoc.html"
    Your relative links will then work and you'll still have
    access to the document object.

    --
    --
    Bill Kearns <bkearns@nospam.com> wrote in message
    news:XJoNb.8847$i4.5994@newsread1.news.atl.earthlink.net...
    > Thank you both but still not working with App.Path which I had already
    > tried. or file:\\\. I even tried reversing all the delimeters throughout

    the
    > path name as in file:/// still nada. The I was thinking it may have to do
    > with spaces in the directory names like "Program Files", so I replaced all
    > spaces with "%20", still no good. I hate to think this can't be done

    because
    > it will sure pull down allot of barriers if I can get it to work! Complete
    > Sub code is below, if anyone would like to look at the vb files just

    e-mail
    > me and I'll zip them up. bkearns(a)goodnewsinteractive.com
    >
    > Private Sub CommandGo_Click()
    >
    > On Error Resume Next
    > Dim SQLWeb1 As String, SearchTxt As String, TransTxt As String, Web1 As
    > Recordset
    >
    > Screen.MousePointer = vbHourglass
    > SearchTxt = SearchText.Text
    > TransTxt = TranslationText.Text
    > 'BookTxt = BookText.Text
    >
    > Dim SearchPic As String
    > SearchPic = App.Path & "\search_results.gif"
    >
    > Dim SQLFixup
    > SQLFixup = Replace(SearchTxt, "'", "''")
    >
    > SQLWeb1 = "SELECT * FROM Comp_Books WHERE Text LIKE '%" & SQLFixup &

    "%'
    > ORDER BY BookNum;"
    > Set Web1 = New Recordset
    > Web1.Open SQLWeb1, db, adOpenStatic, adLockReadOnly
    >
    > Dim URL As Variant
    > Dim HTMLText As String
    > Dim sURL As String
    > sURL = App.Path & "\html\Books\" & Web1.Fields("BookNum").Value & "/"

    &
    > Web1.Fields("Chapter").Value & ".htm"
    > Dim fixURL
    > fixURL = Replace(sURL, " ", "%20")
    > Dim fixURL2
    > fixURL2 = Replace(fixURL, "\", "/")
    > Dim doc As MSHTML.HTMLDocument
    >
    > Set doc = WebBrowser1.Document
    > doc.body.innerHTML = HTMLText
    >
    > HTMLText = "<HTML><BODY BGCOLOR=#FFFFFF topmargin=0 leftmargin=0
    > MARGINWIDTH=0 MARGINHEIGHT=0 >"
    > HTMLText = HTMLText & "<style>"
    > HTMLText = HTMLText & "<!--"
    > HTMLText = HTMLText & ".1 { font-family: ""Verdana""; font-size: 8pt;
    > color: #000000 }"
    > HTMLText = HTMLText & ".2 { font-family: ""Verdana""; font-size: 8pt;
    > color: #000000; background-color: #FFFF00 }"
    > HTMLText = HTMLText & ".3 { font-family: ""Verdana""; font-size: 8pt;
    > color: #0000FF }"
    > HTMLText = HTMLText & ".4 { font-family: ""Verdana""; font-size: 8pt;
    > color: #C0C0C0 }"
    > HTMLText = HTMLText & "-->"
    > HTMLText = HTMLText & "</style>"
    > HTMLText = HTMLText & "<table border=0 cellspacing=1 width=575
    > cellpadding=3>"
    > HTMLText = HTMLText & "<tr>"
    > HTMLText = HTMLText & "<td width=100%>"
    > HTMLText = HTMLText & "<img border=0 src='" & SearchPic & "'
    > align=absmiddle width=36 height=36><font face=Arial size=2
    > color=#000000><B><I>&nbsp;Search Results for """ & SQLFixup &
    > """</I></b></Font><br>"
    > HTMLText = HTMLText & "<P align=justify>"
    > Web1.MoveFirst
    > While Not Web1.EOF
    > HTMLText = HTMLText & "<font face=Verdana color=0000FF size=1>" &
    > Web1.Fields("Book").Value & "&nbsp;" & Web1.Fields("ChapVerse").Value &
    > "</FONT><BR>"
    > HTMLText = HTMLText & "<font face=Verdana color=000000 size=1>" &
    > Web1.Fields("Text").Value & "&nbsp;</FONT><BR>"
    > HTMLText = HTMLText & "<font face=Verdana size=1><a

    href=""file:///"
    > & "" & fixURL2 & """>Read Full Chapter</a></FONT><BR><BR>"
    > Web1.MoveNext
    > Wend
    >
    > HTMLText = HTMLText & "</td>"
    > HTMLText = HTMLText & "</tr>"
    > HTMLText = HTMLText & "</table>"
    > HTMLText = HTMLText & "</BODY></HTML>"
    > WebBrowser1.Document.Script.Document.Clear
    > WebBrowser1.Document.Script.Document.Write HTMLText
    > WebBrowser1.Document.Script.Document.Close
    >
    > Label1.Caption = TranslationCombo.Text
    > Screen.MousePointer = vbDefault
    >
    > End Sub
    >
    >




  6. Default Re: VB6 - WebBrowser Control - about:blank Hyperlinks

    "Bill Kearns" <bkearns@nospam.com> wrote
    > Thank you both but still not working with App.Path which I had already
    > tried. or file:\\\. I even tried reversing all the delimeters throughout the
    > path name as in file:/// still nada. The I was thinking it may have to do
    > with spaces in the directory names like "Program Files", so I replaced all
    > spaces with "%20", still no good. I hate to think this can't be done because
    > it will sure pull down allot of barriers if I can get it to work! Complete
    > Sub code is below, if anyone would like to look at the vb files just e-mail
    > me and I'll zip them up. bkearns(a)goodnewsinteractive.com



    For pete's sake, fire up notepad and type the link in to see what you need!

    <HTML>
    <BODY>
    <A HREF="file:///D:/Temp/APP A/Test.htm">LINK</A>
    </BODY>
    </HTML>

    Launched in IE, that will call up a file in the APP A directory, no matter where
    I call it from. Plug in your own data:

    <A HREF="file:///C:/Whatever/blankhtml/Books/1/18.htm">LINK</A>

    Save it as a .htm file and try it out to see if that calls up the desired page.
    When you get that working, then compare that with the URL you build in VB:

    sURL = App.Path & "\html\Books\" & Web1.Fields("BookNum").Value & "/" & Web1.Fields("Chapter").Value & ".htm"
    Debug.Print sURL

    Debug.Print lets you see what you've put in the string. If they don't match,
    then you need to adjust the VB code so that they do match.

    When you go to solve a problem, you need to break it up into smaller pieces.
    In this case your link isn't working, so find out what the link should be, and
    then see if that is what you've built! I really have a hard time believing that
    has stumped you for days....

    Oh well!
    LFS










    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

  7. Default Re: VB6 - WebBrowser Control - about:blank Hyperlinks

    Larry,

    Your sarcasm and non-help isn't needed. Don't you think I've tried notepad
    and IE? If you read the first post you would have seen that. I can right
    click on the page and view the source in notepad, select and copy the href
    from notepad
    file:///C:/Program%20Files/Good%20News%20Interactive/html/Book/1/18.htm and
    paste it into IE or Netscape and it opens the desired file every time! But
    it still does nothing in VB's WebBrowser. But thanks!



  8. Default Re: VB6 - WebBrowser Control - about:blank Hyperlinks

    > Your sarcasm and non-help isn't needed. Don't you think I've tried notepad
    > and IE? If you read the first post you would have seen that. I can right
    > click on the page and view the source in notepad, select and copy the href
    > from notepad
    > file:///C:/Program%20Files/Good%20News%20Interactive/html/Book/1/18.htm and
    > paste it into IE or Netscape and it opens the desired file every time! But
    > it still does nothing in VB's WebBrowser. But thanks!


    That wasn't sarcasm, it was disbelief that a simple problem would take so
    long to resolve by someone who otherwise looks competent.

    You made no mention of pasting the shortcut into IE, or using notepad to
    create a test page. You did explain that you were trying like heck to get it
    to work in your program, and I am suggesting you should work on a smaller
    test project. Use a project where you don't have any database or large string
    concatenation code, and all the rest. Break it up and only work on creating
    a page with a link that calls up one of your static pages.

    If you create a small project like that, and still have trouble, then you can
    post that entire demo for others to try out. No one is going to have your
    database, or static pages, so they cannot test any of the suggestions. I posted
    a test page which you could have sent to your webbrowser to see if that much
    worked. Did you try that?

    The chances are slim that you've found a bug that causes a URL to work in
    IE but not the webbrowser. If IE handles the link, being that is it a simple
    file, then it should work in your webbrowser. Rather than testing it with all
    that extra stuff, narrow the context down so that you are just testing the link.
    (EX: Make a small demo project and work on it there)

    LFS










    -----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
    http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
    -----== Over 100,000 Newsgroups - 19 Different Servers! =-----

  9. Default Re: VB6 - WebBrowser Control - about:blank Hyperlinks

    Ok maybe I was a little cranky last night, my apologies. I'm not exactly a
    VB guru yet but certainly capable I think and to me there is no logic as to
    why this doesn't work. I think maya's solution of quickly saving the dynamic
    page and re-opening it will work. But I haven't been able to save the html
    doc locally with my minimal skills. If you have a tutorial for saving html
    please send it.

    I did take you advise and started from scratch on a smaller scale.
    Dynamically created http links work fine but dynamically created file:///
    links do not. here is the 15kb project in zip if youre curious
    http://www.goodnewsinteractive.com/p...ink%20Test.zip

    and here is the code:


    ---------------------------------

    Private Sub Form_Load()
    On Error Resume Next
    Me.Move (Screen.Width - Me.Width) \ 2
    Me.Top = 0

    KeyPreview = True
    WebBrowser1.Navigate2 "about:blank"

    Picture1.Appearance = 0
    Picture1.BorderStyle = 1
    Picture1.ScaleMode = vbPixels
    WebBrowser1.Move -2, -2 ', Picture1.Width - 1, Picture1.Height - 1

    CommandGo_Click

    End Sub

    Private Sub CommandGo_Click()
    On Error Resume Next

    Screen.MousePointer = vbHourglass

    Dim URL As Variant
    Dim HTMLText As String

    Set doc = WebBrowser1.Document
    doc.body.innerHTML = HTMLText


    HTMLText = "<HTML><HEAD>"
    HTMLText = HTMLText & "<meta http-equiv=Content-Type content=text/html;
    charset=windows-1252>"
    HTMLText = HTMLText & "</HEAD>"
    HTMLText = HTMLText & "<BODY BGCOLOR=#FFFFFF topmargin=0 leftmargin=0
    MARGINWIDTH=0 MARGINHEIGHT=0 >"
    HTMLText = HTMLText & "<P><a href=http://www.microsoft.com>HTTP Link
    created on the fly</a><br><br>"
    HTMLText = HTMLText & "<P><a
    href=file:///C:/Program%20Files/Good%20News%20Interactive/Hyperlink%20Test/h
    tml/Books/1/1.htm>Link to my local file using FILE:/// created on the
    fly</a><br><br>"
    HTMLText = HTMLText & "</BODY></HTML>"

    WebBrowser1.Document.Script.Document.Clear
    WebBrowser1.Document.Script.Document.Write HTMLText
    WebBrowser1.Document.Script.Document.Close

    Label1.Caption = TranslationCombo.Text
    Screen.MousePointer = vbDefault

    End Sub

    Private Sub Command1_Click()
    WebBrowser1.Navigate2 App.Path & "\html\Books\1\index.htm"
    End Sub



  10. Default Re: VB6 - WebBrowser Control - about:blank Hyperlinks

    The link text, after HREF=, should be in quotes, but maybe
    that doesn't affect it working.
    If you're going to save the file and do it that way you'll need
    to save it to C drive and then write the link for Program Files\....
    If the FILE:/// isn't working then you have to have a relative
    path, which means that the file will have to be saved in a
    parent folder of the place you want to link.

    For writing the file (HTML is just text):

    Private Declare Function DeleteFile Lib "kernel32" Alias "DeleteFileA"
    (ByVal lpFileName As String) As Long

    Public Sub WriteFile(sFilPath As String, ByVal sText As String)
    Dim FF As Integer
    On Error Resume Next
    DeleteFil sFilPath '--delete first if existing.

    FF = FreeFile()
    Open sFilPath For Output As #FF
    Print #FF, sText;
    Close #FF

    End Sub

    Public Sub DeleteFil(sDeletePath As String)
    '--delete a file. --------------------------
    Dim i As Integer
    Dim LDel As Long
    On Error Resume Next
    Err.Clear
    i = GetAttr(sDeletePath)
    If (Err.Number <> 0) Then Exit Sub
    SetAttr sDeletePath, 0
    LDel = DeleteFile(sDeletePath)
    End Sub

    --
    --
    Bill Kearns <bkearns@nospam.com> wrote in message
    news:rkyNb.8519$q4.1708@newsread3.news.atl.earthlink.net...
    > Ok maybe I was a little cranky last night, my apologies. I'm not exactly a
    > VB guru yet but certainly capable I think and to me there is no logic as

    to
    > why this doesn't work. I think maya's solution of quickly saving the

    dynamic
    > page and re-opening it will work. But I haven't been able to save the html
    > doc locally with my minimal skills. If you have a tutorial for saving html
    > please send it.
    >
    > I did take you advise and started from scratch on a smaller scale.
    > Dynamically created http links work fine but dynamically created file:///
    > links do not. here is the 15kb project in zip if youre curious
    > http://www.goodnewsinteractive.com/p...ink%20Test.zip
    >
    > and here is the code:
    >
    >
    > ---------------------------------
    >
    > Private Sub Form_Load()
    > On Error Resume Next
    > Me.Move (Screen.Width - Me.Width) \ 2
    > Me.Top = 0
    >
    > KeyPreview = True
    > WebBrowser1.Navigate2 "about:blank"
    >
    > Picture1.Appearance = 0
    > Picture1.BorderStyle = 1
    > Picture1.ScaleMode = vbPixels
    > WebBrowser1.Move -2, -2 ', Picture1.Width - 1, Picture1.Height - 1
    >
    > CommandGo_Click
    >
    > End Sub
    >
    > Private Sub CommandGo_Click()
    > On Error Resume Next
    >
    > Screen.MousePointer = vbHourglass
    >
    > Dim URL As Variant
    > Dim HTMLText As String
    >
    > Set doc = WebBrowser1.Document
    > doc.body.innerHTML = HTMLText
    >
    >
    > HTMLText = "<HTML><HEAD>"
    > HTMLText = HTMLText & "<meta http-equiv=Content-Type

    content=text/html;
    > charset=windows-1252>"
    > HTMLText = HTMLText & "</HEAD>"
    > HTMLText = HTMLText & "<BODY BGCOLOR=#FFFFFF topmargin=0 leftmargin=0
    > MARGINWIDTH=0 MARGINHEIGHT=0 >"
    > HTMLText = HTMLText & "<P><a href=http://www.microsoft.com>HTTP Link
    > created on the fly</a><br><br>"
    > HTMLText = HTMLText & "<P><a
    >

    href=file:///C:/Program%20Files/Good%20News%20Interactive/Hyperlink%20Test/h
    > tml/Books/1/1.htm>Link to my local file using FILE:/// created on the
    > fly</a><br><br>"
    > HTMLText = HTMLText & "</BODY></HTML>"
    >
    > WebBrowser1.Document.Script.Document.Clear
    > WebBrowser1.Document.Script.Document.Write HTMLText
    > WebBrowser1.Document.Script.Document.Close
    >
    > Label1.Caption = TranslationCombo.Text
    > Screen.MousePointer = vbDefault
    >
    > End Sub
    >
    > Private Sub Command1_Click()
    > WebBrowser1.Navigate2 App.Path & "\html\Books\1\index.htm"
    > End Sub
    >
    >




+ Reply to Thread
Page 1 of 2 1 2 LastLast

Similar Threads

  1. Webbrowser control and IE 7
    By Application Development in forum Clipper
    Replies: 1
    Last Post: 09-20-2007, 09:51 PM
  2. WebBrowser control in .Net 3. Is it possible???
    By Application Development in forum DOTNET
    Replies: 4
    Last Post: 07-02-2007, 03:35 PM
  3. Using ExecWB to control font size in a WebBrowser control
    By Application Development in forum basic.visual
    Replies: 2
    Last Post: 07-01-2007, 03:44 PM