Solved

VB6 and Outlook 2010

Posted on 2016-11-17
4
29 Views
Last Modified: 2016-11-17
I have a vb6 program that has the customers email address.  I need be able to click on a button that Creates a new outlook 2012 email and puts in the address so I can manually put in the subject and finish the email.

Any examples of how this can be done will be appreciated.
0
Comment
Question by:PhilChapmanJr
[X]
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
  • 2
  • 2
4 Comments
 
LVL 9

Accepted Solution

by:
Karen earned 500 total points
ID: 41892327
Do you want to use the default email client on the system, or Outlook 2010 specifically?
It is easier to do it for the default client.

' Using the ShellExecute API call allows support for all email clients.
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 Const SW_SHOW  As Long = 1

Public Sub LaunchMailClient(Optional MailToAddress As String = vbNullString)
Dim j       As Long
 
    j = ShellExecute(0&, "open", "mailto:" & MailToAddress, vbNullString, vbNullString, SW_SHOW)
    If j = 0 Then
        ' Error launching default mail client - do something appropriate here
    End If
End Sub

Open in new window

1
 
LVL 2

Author Comment

by:PhilChapmanJr
ID: 41892339
Karen this is a PERFECT solution
0
 
LVL 2

Author Closing Comment

by:PhilChapmanJr
ID: 41892340
Perfect solution
0
 
LVL 9

Expert Comment

by:Karen
ID: 41892343
:) I'm glad I could help you.
0

Featured Post

Windows running painfully slow? Try these tips..

Stay away from Speed Up Computer Programs that do more harm than good.
Try these tips instead.
Step by step instructions in trouble shooting Windows Performance issues.

Question has a verified solution.

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

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

752 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