Solved

VB6 and Outlook 2010

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Outlook Free & Paid Tools
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

809 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