Link to home
Start Free TrialLog in
Avatar of djross
djross

asked on

using the default email program

Hey,
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?

Thanks!

Doug
Avatar of OeilNoir
OeilNoir

What control do you use? do you use MAPI?
Avatar of djross

ASKER

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)
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.

Avatar of djross

ASKER

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).  


ASKER CERTIFIED SOLUTION
Avatar of myqlG
myqlG

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of djross

ASKER

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.
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...