Solved

VB6 and Outlook 2010

Posted on 2016-11-17
4
21 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
  • 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
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…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

832 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