Solved

using the default email program

Posted on 1998-12-15
7
173 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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 

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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

778 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