I just got a helpful tips about opening the default e-mail-program by calling the function Shell("c:\Program\Microsoft Office\Office\outlook.exe"
But what if the user/customer doesn´t have the default mail-client on that "hard-coded" path.
How can you make the application dynamically set the path
for each and every different system??
Do like CIMD suggests and call ShellExecute with a "mailto:" link. This will automatically open the default email program, whether it's Outlook Express, Eudora, or whatever.
What happens is the shell recognizes that it's an email link, and looks in the registry to find what program is registered to respond. It then calls that program, which ought to open up a new message form with the destination address already filled in (some might not).
If you want to open te default mail-client just declare the shellExecute API and call it:
Sub Email()
ret = ShellExecute(0&, vbNullString, "mailto: Perra@perra.es" ,vbNullString, "C:\", 1)
endSub
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
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.