A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

e- mail link



 
 
Thread Tools Display Modes
  #1  
Old December 15th, 2006, 03:45 PM posted to microsoft.public.access.forms
KPE
external usenet poster
 
Posts: 6
Default 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  
Old December 17th, 2006, 01:34 AM posted to microsoft.public.access.forms
Geoff
external usenet poster
 
Posts: 99
Default 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  
Old December 17th, 2006, 10:07 AM posted to microsoft.public.access.forms
Geoff
external usenet poster
 
Posts: 99
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 06:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.