|
-
May 7th, 2006, 05:44 AM
#1
Thread Starter
Addicted Member
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:
Private Sub Form_Load()
WebBrowser1.Navigate "about:" & _
"<html>" & vbCrLf & _
"<head>" & vbCrLf & _
"</head>" & vbCrLf & _
"<body>" & vbCrLf & _
"<p><a target=" & Chr$(34) & "_blank" & Chr$(34) & "href=" & Chr$(34) & _
"http://www.vbforums.com" & Chr$(34) & ">Visit My Site</a></p>" & vbCrLf & _
"</body>" & vbCrLf & _
"</html>"
' or load your ad page
End Sub
Where i can learn to use this part ?
Last edited by RoYeti; May 7th, 2006 at 05:59 AM.
-
May 7th, 2006, 05:47 AM
#2
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
May 7th, 2006, 05:50 AM
#3
Thread Starter
Addicted Member
Re: html code in vb code !
no .. i just want to be opened in webbrowser1.
-
May 7th, 2006, 05:52 AM
#4
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
May 7th, 2006, 05:54 AM
#5
Thread Starter
Addicted Member
Re: html code in vb code !
can it just be like this one?
VB Code:
Private Sub Form_Load()
WebBrowser1.Navigate "about:" & _
"<html>" & vbCrLf & _
"<head>" & vbCrLf & _
"</head>" & vbCrLf & _
"<body>" & vbCrLf & _
"<p><a target=" & Chr$(34) & "_blank" & Chr$(34) & "href=" & Chr$(34) & _
"http://www.vbforums.com" & Chr$(34) & ">Visit My Site</a></p>" & vbCrLf & _
"</body>" & vbCrLf & _
"</html>"
' or load your ad page
End Sub
using " " _ etc.. i do not know how to use this ..
-
May 7th, 2006, 06:02 AM
#6
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 Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API 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 
-
May 7th, 2006, 06:08 AM
#7
Thread Starter
Addicted Member
Re: html code in vb code !
Why not? this code it`s work ..
VB Code:
Private Sub Form_Load()
WebBrowser1.Navigate "about:" & _
"<html>" & vbCrLf & _
"<head>" & vbCrLf & _
"</head>" & vbCrLf & _
"<body>" & vbCrLf & _
"<p><a target=" & Chr$(34) & "_blank" & Chr$(34) & "href=" & Chr$(34) & _
"http://www.vbforums.com" & Chr$(34) & ">Visit My Site</a></p>" & vbCrLf & _
"</body>" & vbCrLf & _
"</html>"
' or load your ad page
End Sub
Where can i find a tutorial to learn to do transform the html code to vb code ?
-
May 7th, 2006, 06:33 AM
#8
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|