how do you get vb to open a website in a new window?
thanks
matt
You can reset the internet address you want it to display
when it loads.
If Len(StartingAddress) > 0 Then
cboAddress.Text = StartingAddress
change the above line
cboAddress.AddItem cboAddress.Text
'try to navigate to the starting address
timTimer.Enabled = True
brwWebBrowser.Navigate StartingAddress
End If
* Sent from AltaVista http://www.altavista.com Where you can also find related Web Pages, Images, Audios, Videos, News, and Shopping. Smart is Beautiful
what i ment is the following.
I have a button on a form. When you click on it, i want it to open the
default web browser and go to that address. The only probelm is that the
code that i have will open in in an internet explorer window that is open
already.
I want it to open it in a brand new window
thanks
matt
Dougie Browser <starwalke...@snowcrest.net.invalid> wrote in message
news:2885bff5...@usw-ex0109-069.remarq.com...
>Ben Bishop asked this exact same question two days ago. Anyway, since =
>nobody replied, I decided to code a solution and post it earlier today. =
>Here is what I replied with:
I was surprised that your posting had sigfnificantly different
encoding than the e-mail version you had sent me. The version on
c.l.v-b.m had both text and html version, both of which were
absolutely useless for cutting and pasting using my text newsgroup
reader (but the e-mail was easier, thanks) (see the above quote-lines
for an example of one of the problems -- the trailing "="s which I
believe are part of mime-encoding)
In either case, the code didn't work in VB5, the first error being the
use of "InStrRev" which was not found. Since I had a working
alternative by then, I didn't try to hunt down any other possible
problems.
I appologize for not mentioning the version of VB I was working with.
Ian Williams sent me some other code which does seem to work in VB5
(and does exactly what I need); I hope he doesn't mind me posting it,
but I didn't see his response in the newsgroup...
From: Ian Williams <i...@kingsoft-denmark.com>
To: Ben Bishop <a...@shore.net>
Subject: Re: starting a _new_ browser window
you can do it like this, just call the Sub LaunchNewBrowser, passing
it the URL you want to display.
********
'Module code
Option Explicit
Option Compare Text
Private Declare Function FindExecutable Lib "shell32.dll" Alias _
"FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As String, _
ByVal lpResult As String) As Long
Dim strDefPath As String
Sub LaunchNewBrowser(strURL As String)
Dim z
If strDefPath = "" Then strDefPath = GetExePath("htm")
If strDefPath = "NoExtension" Or strDefPath = "NoDefApp" Then
'Handle error
Else
z = Shell(strDefPath & " " & strURL, 1)
End If
End Sub
Private Function GetExePath(Extension As String) As String
Dim Result As String, z As Long, Path As String
Dim FileName As String, fnum As Integer
If Extension = "" Then
GetExePath = "NoExtension"
Exit Function
End If
Result = Space$(270)
Path = Environ("temp") & "\"
FileName = "~testing." & Extension
fnum = FreeFile
Open Path & FileName For Output As #fnum
Close #fnum
z = FindExecutable(FileName, Path, Result)
Kill Path & FileName
Do While fnum > 0
fnum = InStr(Result, Chr(0))
If fnum > 0 Then Mid(Result, fnum, 1) = " "
Loop
Result = Trim(Result)
fnum = InStr(Result, ".EXE")
If Len(Result) > 0 And fnum > 0 Then
Result = Left$(Result, fnum) & "EXE"
GetExePath = Result
Else
GetExePath = "NoDefApp"
End If
End Function
**********
regards
Ian Williams
homepage http://www.kingsoft-denmark.com/
----- Original Message -----
From: Ben Bishop <a...@shore.net>
Newsgroups: comp.lang.basic.visual.misc
Sent: Friday, January 21, 2000 11:01 PM
Subject: starting a _new_ browser window
> I'm sure part of this is in a faq -- I've seen it ot posed often enough,
> but there is a twist to it.
>
> My VB program has a url it wants to launch (actually, it may have many).
>
> Is there any syntax which will launch the browser in a _new_ window?
> I don't particularly like having an existing window taken over and
> replaced by the new page.
>
> Any help would be appreciated.
>
> Ben Bishop
> aci @ shore.net
Dim URL As String
Private Sub Command1_Click()
webbrwsr = Shell("Start " & URL, vbNormalFocus)
End
End Sub
That should open the default web browser
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!