Solved

VB6 and Outlook 2010

Posted on 2016-11-17
4
8 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 Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
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).
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…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now