Solved

How to determine the default email program

Posted on 2002-06-20
7
147 Views
Last Modified: 2010-05-02
How to determine the default Email program running in the system (i.e, Microsoft Outlook, Outlook Express) in VB.
I am developing one application and I want to include this functionality by just clicking a single Button then the program will automatically open the default Email Software.
Any help would be much appreciated. Thank you.
0
Comment
Question by:arnoldgh
7 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7097779
You could use shellexecute api with Mailto. It will opens your default email program.
There is another way that doesn't take cares of which one you use:
http://www.freevbcode.com/ShowCode.Asp?ID=109
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7098335
Use "mailto:"

' Form1
Option Explicit
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

Private Sub Form_Click()
   Dim ret As Long, mailInfo(0 To 4) As String
   mailInfo(0) = "aaa@aaa"
   mailInfo(3) = "Report for %D"
   mailInfo(4) = "Hi, I'm sending report for %D.  Regards, "

   ' open 'new message' in OE
   ret = ShellExecute(Me.hwnd, vbNullString, _
       "mailto:" & mailInfo(0) _
       & "?CC=" & mailInfo(1) _
       & "&BCC=" & mailInfo(2) _
       & "&Subject=" & Replace(mailInfo(3), "%D", Format(Date, "dd.mm.yyyy") & _
           " (" & WeekdayName(Weekday(Date, vbMonday), , vbMonday) & ")") _
       & "&Body=" & Replace(mailInfo(4), "%D", Format(Date, "dd.mm.yyyy") & _
           " (" & WeekdayName(Weekday(Date, vbMonday), , vbMonday) & ")") _
       , vbNullString, "c:\", 1)
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7169812
Hi, any progress here? Need more help?
0
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7348097
This question appears to be abandoned. A question regarding it will be left in the CleanUp
area; if you have any comment about the question, please leave it here.

Unless there is objection or further activity, one of the moderators will be asked to split points between <emoreau> and <Richie_Simonetti>.

DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
0
 

Author Comment

by:arnoldgh
ID: 7348735
Hi Richie and Emoreau,
    First of all, I would like to apologize for this questionaire because I think I made two instances of the same question of the same date. Actually, this question has already got an answer and I had already accepted it since 24th of June, 2002. The accepted answer came from "
Tetrode" and here is it:
 "see HKEY_CLASSES_ROOT\mailto\shell\open\command.
I would like to request the moderator to please ignore this question and put it in the CleanUp area. Once again, to Richie and Emoreau, sorry guys for the inconvenience and thank you.

Regards,
Arnold
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7349346
In this case, you need to ask yourself for a delete in the Community Support area.
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7358563
Points refunded and question closed.

Netminder
CS Moderator
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
String manipulation in Visual Basic 7 73
vb6 connector to mongodb 2 122
Hide vba in gp 7 106
Export PDF Form fields to Access  or Excel  in Tab order 16 80
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question