cappy2112
May 16th, 2005, 09:04 PM
I want to execute a mailto in a sub in vbscript,
but it looks like you can't use declare statements to reference DLLs, in vbscript.
I want to be able to effectively execute this code below, so the script can send a simple email.
How can I get around these limitations in VBscript?
Public Const URL = "http://www.hotmail.com"
Public Const email = "panasonicsubz@hotmail.com"
Public 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
Public Const SW_SHOWNORMAL = 1
Public Sub gotoweb()
Dim Success As Long
Success = ShellExecute(0&, vbNullString, URL, vbNullString, "C:\", SW_SHOWNORMAL)
End Sub
Public Sub sendemail()
Dim Success As Long
Success = ShellExecute(0&, vbNullString, "mailto:" & email, vbNullString, "C:\", SW_SHOWNORMAL)
End Sub
but it looks like you can't use declare statements to reference DLLs, in vbscript.
I want to be able to effectively execute this code below, so the script can send a simple email.
How can I get around these limitations in VBscript?
Public Const URL = "http://www.hotmail.com"
Public Const email = "panasonicsubz@hotmail.com"
Public 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
Public Const SW_SHOWNORMAL = 1
Public Sub gotoweb()
Dim Success As Long
Success = ShellExecute(0&, vbNullString, URL, vbNullString, "C:\", SW_SHOWNORMAL)
End Sub
Public Sub sendemail()
Dim Success As Long
Success = ShellExecute(0&, vbNullString, "mailto:" & email, vbNullString, "C:\", SW_SHOWNORMAL)
End Sub