Results 1 to 8 of 8

Thread: html code in vb code !

  1. #1

    Thread Starter
    Addicted Member RoYeti's Avatar
    Join Date
    Dec 2005
    Posts
    165

    Arrow html code in vb code !

    hy i want my program to open in webbrowser1 a webpage from a html code. i don`t know how to put the code in vb code. the html code is
    HTML Code:
    <SCRIPT type=text/javascript>
    id = 5406;
    width = 468;
    height = 60;
    
    border = "000000";
    background = "000000";
    link = "00FFFF";
    text = "FFFFFF";
    </SCRIPT>
    <SCRIPT src="http://web.to.ro/textad.js" type=text/javascript>
    </SCRIPT>
    and i want to be like this :
    VB Code:
    1. Private Sub Form_Load()
    2.     WebBrowser1.Navigate "about:" & _
    3.        "<html>" & vbCrLf & _
    4.        "<head>" & vbCrLf & _
    5.        "</head>" & vbCrLf & _
    6.        "<body>" & vbCrLf & _
    7.        "<p><a target=" & Chr$(34) & "_blank" & Chr$(34) & "href=" & Chr$(34) & _
    8.        "http://www.vbforums.com" & Chr$(34) & ">Visit My Site</a></p>" & vbCrLf & _
    9.        "</body>" & vbCrLf & _
    10.        "</html>"
    11. ' or load your ad page
    12. End Sub
    Where i can learn to use this part ?
    Last edited by RoYeti; May 7th, 2006 at 05:59 AM.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: html code in vb code !

    You will want to write it out to a htm file and then navigate to that?

    If you want to do it dynamically then you may want to look at the Document.Write function.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Addicted Member RoYeti's Avatar
    Join Date
    Dec 2005
    Posts
    165

    Re: html code in vb code !

    no .. i just want to be opened in webbrowser1.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: html code in vb code !

    Then what about writting the html out to a htm file and .navigate2 to that?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Addicted Member RoYeti's Avatar
    Join Date
    Dec 2005
    Posts
    165

    Re: html code in vb code !

    can it just be like this one?
    VB Code:
    1. Private Sub Form_Load()
    2.     WebBrowser1.Navigate "about:" & _
    3.        "<html>" & vbCrLf & _
    4.        "<head>" & vbCrLf & _
    5.        "</head>" & vbCrLf & _
    6.        "<body>" & vbCrLf & _
    7.        "<p><a target=" & Chr$(34) & "_blank" & Chr$(34) & "href=" & Chr$(34) & _
    8.        "http://www.vbforums.com" & Chr$(34) & ">Visit My Site</a></p>" & vbCrLf & _
    9.        "</body>" & vbCrLf & _
    10.        "</html>"
    11. ' or load your ad page
    12. End Sub
    using " " _ etc.. i do not know how to use this ..

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: html code in vb code !

    I believe you can not write a page that way. It needs to be a file located on a web server or your local system.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Addicted Member RoYeti's Avatar
    Join Date
    Dec 2005
    Posts
    165

    Re: html code in vb code !

    Why not? this code it`s work ..
    VB Code:
    1. Private Sub Form_Load()
    2.     WebBrowser1.Navigate "about:" & _
    3.        "<html>" & vbCrLf & _
    4.        "<head>" & vbCrLf & _
    5.        "</head>" & vbCrLf & _
    6.        "<body>" & vbCrLf & _
    7.        "<p><a target=" & Chr$(34) & "_blank" & Chr$(34) & "href=" & Chr$(34) & _
    8.        "http://www.vbforums.com" & Chr$(34) & ">Visit My Site</a></p>" & vbCrLf & _
    9.        "</body>" & vbCrLf & _
    10.        "</html>"
    11. ' or load your ad page
    12. End Sub
    Where can i find a tutorial to learn to do transform the html code to vb code ?

  8. #8

    Thread Starter
    Addicted Member RoYeti's Avatar
    Join Date
    Dec 2005
    Posts
    165

    Re: html code in vb code !

    ok .. i write the code .. and you have right. Thenx for help

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