Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


using the default email program

Posted on 1998-12-15
Medium Priority
Last Modified: 2010-05-03
I'm writing a address book type program for my office in Visual Basic and I put a button on it that launches the default email client (through an API call) and sends an email if an email address exists for that person. We use Groupwise for our email system but, on most of the computers here, when I click that email button, Windows wants to load Outlook (which we don't use).  Does anyone have a  uggestion as to how I make Groupwise the default email program instead of Outlook?


Question by:djross
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3

Expert Comment

ID: 1450337
What control do you use? do you use MAPI?

Author Comment

ID: 1450338
I'm not sure, I got the code from a friend:

In the General Declarations section,

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

and, where sEmail is a string containing the email address,

Call ShellExecute(hwnd, "Open", sURL, "", App.Path, 1)

Expert Comment

ID: 1450339
is that the code in the email button?
do the program try to start outlook when it try to send the mail? or when you try to load the email program?
what do you use to handle email sending ? (with smtp etc...)

if the problem is about loading the groupewise program, i suggest you try to find a key in the registry who refert to it.. then your program could go read it and would know the path of the program... so you could luach it wherever it is installed.

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 1450340
Yes, the second section of code is in the email button.  

When I click the 'send email' button in my program, the GroupWise program is launched and a new email is created with the TO field already filled out.  But, on other computers, when the 'send email' button is pressed, Microsoft Outlook begins to load and then gives an error stating that it couldn't create the new mail and Outlook closes.  

I went through the registry on my computer (which launches GroupWise correctly when that button is pressed) and found a few places that referred to the grpwise.exe file (GroupWise).  I would rather not go into everyone's registry and change that since there has to be a way to do it otherwise (because I didn't have to set up mine that way).  There isn't an option in GroupWise to check whether it is the default email program or not (like Netscape, IE check if they are the default browser).  


Accepted Solution

myqlG earned 100 total points
ID: 1450341
The above answer is correct.. shellexecute is the way.
go here to d/l a sample to understand it better:

Author Comment

ID: 1450342
Well, that page does help me understand what the API call does exactly, it still leaves me with my problem of Outlook trying to load as the default email program instead of GroupWise.

Expert Comment

ID: 1450343
sorry i don't know if there is something like netscape, but with the registry (you don't change anything just read it) you are sure some keys will always be at the same place (ie: in the uninstalled information section) you always find the path and such info. i did that for one of my program to find where an other program was installed and it worked fine...

well.. this is just a suggestion...

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

688 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