?
Solved

VB6 and Outlook 2010

Posted on 2016-11-17
4
Medium Priority
?
40 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 2000 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

719 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