If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
e- mail link
I have a text box that has customers e-mail address in it. I would like to
double click on it, open up my e -mail and insert the customers address so I can compose mail. I use comcast.net , do I need to use outlook, if so can you help with that? edward keith |
#2
|
|||
|
|||
e- mail link
Edward:
I have a text box that has customers e-mail address in it. I would like to double click on it, open up my e -mail and insert the customers address so I can compose mail. I use comcast.net , do I need to use outlook, if so can you help with that? You need to write code for the Textbox's DblClick event. Yes, you need to use Outlook. It's best to initialise Outlook once, when your form loads. Below is a demonstration of the code you might put in the form's class module. Geoff Option Compare Database Option Explicit Private mobjOLA As Outlook.Application Private mobjNSP As Outlook.NameSpace Private Sub Form_Load() Set mobjOLA = CreateObject("Outlook.Application") Set mobjNSP = mobjOLA.GetNamespace("MAPI") mobjNSP.Logon , , True, False End Sub Private Sub Form_Unload(Cancel As Integer) Set mobjNSP = Nothing Set mobjOLA = Nothing End Sub Private Sub txtEmailAddress_DblClick(Cancel As Integer) Dim objMI As Outlook.MailItem Dim strEmailAddress As String strEmailAddress = Me.txtEmailAddress Set objMI = mobjOLA.CreateItem(olMailItem) objMI.To = strEmailAddress objMI.Display Set objMI = Nothing End Sub |
#3
|
|||
|
|||
e- mail link
Edward:
Incidentally, you will need a reference to the Outlook object library. In the VBA editor, open the Tools menu, select References, and, in the References dialog, select Micosoft Outlook Object Library. Geoff |
Thread Tools | |
Display Modes | |
|
|