-
Dec 29th, 2021, 10:32 AM
#1
Thread Starter
Junior Member
Commend button to pen an internet browser.
Hi.
While developing a web browser I created a command that open an internet window in Explorer.
Now, How can we add a command button to open Google Chrome instead of Internet Explorer?
Tks
-
Dec 29th, 2021, 11:24 AM
#2
Re: Commend button to pen an internet browser.
-
Dec 29th, 2021, 09:30 PM
#3
Re: Commend button to pen an internet browser.
There is no such thing as an "internet window." I think you are trying to say something more like "web page."
-
Dec 29th, 2021, 10:22 PM
#4
Thread Starter
Junior Member
Re: Commend button to pen an internet browser.
Hi.
I am not so familiar with this action. I am kind of new on this. Can you be more clear?
So in the command1 button what code shall I write so the web page opens in Chrome instead of Explorer?
Tks.
-
Dec 30th, 2021, 02:24 AM
#5
Re: Commend button to pen an internet browser.
What do you use at the moment to show a webpage?
-
Dec 30th, 2021, 11:00 AM
#6
Re: Commend button to pen an internet browser.
Originally Posted by Ricardonlc
Hi.
While developing a web browser I created a command that open an internet window in Explorer.
Now, How can we add a command button to open Google Chrome instead of Internet Explorer?
Tks
Maybe this will help. I have used this routine for years to read an HTML encoded file in my default browser.
J.A. Coutts
Code:
Private Sub cmdHTML_Click()
Dim TempPath As String
Dim TempFile As String
Dim strBrowser As String
Dim TmpFile%
Dim lStart As Long
Dim lEnd As Long
Dim RetVal As Long
'Find HTML portion of message
If InStr(1, strContent, "text/html", 1) > 0 Then 'HTML only
lStart = 1
lEnd = Len(MessageBuffer)
Else 'MultiPart
lStart = InStr(1, MessageBuffer, "text/html", 1)
If lStart > 0 Then
lStart = InStr(lStart, MessageBuffer, vbCrLf & vbCrLf) + 4
lEnd = InStr(lStart, MessageBuffer, strBoundary)
End If
End If
If lStart = 0 Then
MsgBox "HTML code not found in current message!", vbExclamation
Exit Sub
End If
If lEnd = 0 Then lEnd = Len(MessageBuffer)
TempPath = GetTmpPath
ID = Mid$(Me.Caption, 14)
TempFile = "jac" & ID & ".htm"
TmpFile% = OpenFile(TempPath & TempFile, 1, 0, 512)
If TmpFile% = 0 Then
MsgBox "File Error with " & TempFile, 16, "ABORT PROCEDURE"
Exit Sub
End If
Print #TmpFile%, Mid$(MessageBuffer, lStart, lEnd - lStart)
Close TmpFile%
If Len(TempPath) Then
RetVal = ShellExecute(0&, "open", TempPath & TempFile, 0, 0, 1)
End If
End Sub
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
|