Solved

using the default email program

Posted on 1998-12-15
7
182 Views
Last Modified: 2010-05-03
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
0
Comment
Question by:djross
  • 3
  • 3
7 Comments
 
LVL 1

Expert Comment

by:OeilNoir
ID: 1450337
What control do you use? do you use MAPI?
0
 

Author Comment

by:djross
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)
0
 
LVL 1

Expert Comment

by:OeilNoir
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.

0
Industry Leaders: 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

by:djross
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).  


0
 
LVL 3

Accepted Solution

by:
myqlG earned 50 total points
ID: 1450341
The above answer is correct.. shellexecute is the way.
go here to d/l a sample to understand it better:
http://www.mvps.org/vbnet/code/shell/shellexecute.htm
0
 

Author Comment

by:djross
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.
0
 
LVL 1

Expert Comment

by:OeilNoir
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...
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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…
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…

685 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