|
-
Jun 20th, 2005, 09:01 PM
#1
Thread Starter
Member
Webbrowser control - how to display only ONE specific html file
Hello,
I am using a web browser control on a VB form to display html files from a mapped drive on the network. I am not sure if this is the best way to do what i want, but the code was already there so I have just started using it. I want to display say e.g., there is an html file About 123.html and I want to display this file, I use the Navigate method with complete path and name of the file. Now, the problem is the web browser control first goes to the Default.htm file in the same folder (which is the intranet folder) and displays the whole intranet in the web browser and then goes to the file in question.
All I want is to be able to display the About 123.html and that's it. How can I do this??
-
Jun 20th, 2005, 10:32 PM
#2
Re: Webbrowser control - how to display only ONE specific html file
Moved to Classic VB Forum.
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 
-
Jun 20th, 2005, 10:55 PM
#3
Re: Webbrowser control - how to display only ONE specific html file
Could you post your code?
-
Jun 21st, 2005, 12:10 AM
#4
Thread Starter
Member
Re: Webbrowser control - how to display only ONE specific html file
Sure, here is the code. However, I just noticed that it seems to be working sometimes and other times not. So, I m not too worried about it now. Although, I would like to know if there is anything I m doing wrong.
VB Code:
strAboutFile = Dir(CONST_DIR & "\About " & Me.lstFileName.List(lstFileName.ListIndex) & ".htm")
If strAboutFile = "" Then
strAboutFile = Dir(CONST_DIR & "\NoHelpFile.htm")
Me.lstHelpFiles.AddItem "TemplateList", 0
Me.lstHelpFiles.AddItem "NoHelpFile", 1
Else
Me.lstHelpFiles.AddItem "TemplateList", 0
Me.lstHelpFiles.AddItem "About " & Me.lstFileName.List(lstFileName.ListIndex), 1
End If
'Me.lstHelpFiles.AddItem strAboutFile
Me.WebBrowser.Navigate2 CONST_DIR & strAboutFile
- strAboutFile holds the name of the html file to be displayed
- lstHelpFiles is a list box of documents to choose from - html file relates to the selection made
- CONST_DIR contains the absolute path of the html file
Thanks,
-
Jun 21st, 2005, 05:01 AM
#5
Re: Webbrowser control - how to display only ONE specific html file
This doesn't seem to be a problem with the WebBrowser control. Your strAboutFile variable doesn't seem to hold the correct value. Just put a breakpoint on the last line and check the value of CONST_DIR & strAboutFile.
Moreover I think the correct line should be:
VB Code:
Me.WebBrowser.Navigate2 CONST_DIR & "\" & strAboutFile
Last edited by Pradeep1210; Jun 21st, 2005 at 05:05 AM.
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
|