Einen URL im Standardbrowser öffnen
Dienstag, 10. September 2002 18:25
'API-Function deklarieren
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
'Konstante deklarieren
Private Const SW_SHOWNORMAL = 1
'------------------------------------------------------------
Private Sub btnSenden_Click()
Dim tsDummy
tsDummy = tsSendAnMail(txtAdresse.Text, txtKopie.Text, txtBetreff.Text, txtText.Text)
End Sub
'------------------------------------------------------------
Private Sub btnURL_Click()
Dim tsDummy
tsDummy = tsOpenURL(txtURL.Text)
End Sub
'------------------------------------------------------------
Function tsOpenURL(tsURL As String)
tsOpenURL = ShellExecute(0&, vbNullString, tsURL, vbNullString, vbNullString, SW_SHOWNORMAL)
End Function
'------------------------------------------------------------
Function tsSendAnMail(tsAdresse As String, tsCopy As String, tsBetreff As String, stText As String)
Dim tsEmail As String
tsEmail = "mailto:" & txtAdresse & "?CC=" & txtKopie & "&Subject=" & txtBetreff & "&Body=" & txtText
tsSendAnMail = ShellExecute(0&, vbNullString, tsEmail, vbNullString, vbNullString, SW_SHOWNORMAL)
End Function
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, _
ByVal lpOperation As String, ByVal lpFile As String, _
ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
'Konstante deklarieren
Private Const SW_SHOWNORMAL = 1
'------------------------------------------------------------
Private Sub btnSenden_Click()
Dim tsDummy
tsDummy = tsSendAnMail(txtAdresse.Text, txtKopie.Text, txtBetreff.Text, txtText.Text)
End Sub
'------------------------------------------------------------
Private Sub btnURL_Click()
Dim tsDummy
tsDummy = tsOpenURL(txtURL.Text)
End Sub
'------------------------------------------------------------
Function tsOpenURL(tsURL As String)
tsOpenURL = ShellExecute(0&, vbNullString, tsURL, vbNullString, vbNullString, SW_SHOWNORMAL)
End Function
'------------------------------------------------------------
Function tsSendAnMail(tsAdresse As String, tsCopy As String, tsBetreff As String, stText As String)
Dim tsEmail As String
tsEmail = "mailto:" & txtAdresse & "?CC=" & txtKopie & "&Subject=" & txtBetreff & "&Body=" & txtText
tsSendAnMail = ShellExecute(0&, vbNullString, tsEmail, vbNullString, vbNullString, SW_SHOWNORMAL)
End Function