Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Click on E-mail address and Create Mail 1

Status
Not open for further replies.

BillMc

Programmer
Dec 8, 2000
45
0
0
US
My form contains a field "EMAIL", data type Hyperlink. I want to click on this field and have the following event take place: 1.Open Outlook Express, 2. Create Mail, 3. Automatically enter this "EMAIL" field as the send to address. How do I accomplish this? Thanks, Bill
 
try insert hyperlink, then a option for email addresses is offered.
 
Thanks for your help. This is really works well. Bill
 
Ok I'm not there yet. I want to click on the email field and have the address that is in that field, which is different for each customer, go to Mail to field in Outlook. Bill
 
I have recently had help here with the same problem, don't know if this helps you but here goes...i have a feild called "EmailName1" that contains my contacts email address, i then made a command button beside the field and in the onclick event procedure i entered this code:
Private Sub Form_Click()

On Error Resume Next
DoCmd.SendObject acSendNoObject, , acFormatRTF, Me![EmailName1], , , , , -1

End Sub

you could substitute [EmailName1] with the name of your field and try it, I did not put mailto: in the hyperlink address for the command button because i found that it opened a blank outlook express window after the window with the email address contained in my field "EmailName1" so leave it blank.So far it's working ok, hope this is of some help to you
 
Kaygirl, I tried it. Here is the code I entered:


Private Sub Command101_Click()

On Error Resume Next
DoCmd.SendObject acSendNoObject, , acFormatRTF, Me
[EmailAddress] , , , , , -1

End Sub

I am getting a compile error: "Invalid use of property" and it highlights [EmailAddress]

What data type should my field be? Hyperlink, Text, or ???

Also, other than setting up the Event Procedure properly with the correct code etc, do I need to do anything else in the properties of this command button to make this happen? When I choose a command button from my Tool Box what category and action should I choose.

Thanks for your help.

Bill
 
The field be set to text.When you place a command button and it requests you to take an option press cancel.You can now enter the code in the onclick event procedure
i renamed my button "cmdemail" so my code looks like this

Private Sub cmdemail_Click()

On Error Resume Next
DoCmd.SendObject acSendNoObject, , acFormatRTF, Me![EmailName1], , , , , -1



End Sub

hope it works this time....
 
The code works fine now. No errors. We are almost there. When I click the command button I get this message:

"You cannot create a new Microsft Outlook profile at this time. To create a new profile, open the Control Panel, double-click the Mail icon, and then click Show Profiles."

So I opened up the Mail dialog box there is not a "Show Profiles" tab or button, however, there is "Add" button. So I clicked on that and it wants me to create a new Profile and give it a name. What name do I need to give it? Thanks for your help and patience. Bill

bill@bmcauley.com
 
I think you can use any name, it is just for your reference when you are looking at your mail or if you have several mail accounts on the one computer.What you will need however is your incoming and outgoing server information for your email account for example pop3(incoming mail) for a ntl connection is "pop.ntlworld.com" and smtp(outgoing mail) is "smtp.ntlworld.com" , then you will need your user name and password that you use to connect to your service provider.Once you have set all of this up it should open your window and be ready to send the email.Hope this can be of some use,,,
 
Kay, Thanks for your help. It works!

I have one more question. I am going to create a "Subject" and a "Message" field now on this same form. Both fields are going to be combo boxes with pre-written messages to pick from. I assume that I can tell those fields to go into the appropriate places in Outlook Mail.

Can you show me the code for that? Now that you have given me the basics, I should be able to finish this up.

Thanks for being so generous with your time and talent.

Bill
 
Sorry about the delay in answering. I think you can use combo boxes with your subjects displayed and put it in your exhisting code like this, if your email cc field is called
"Cc" and your subject field is called "Subject" your code would look like this

Private Sub Command101_Click()

On Error Resume Next
DoCmd.SendObject acSendNoObject, , acFormatRTF, Me
[EmailAddress] ,[Cc] , , [Subject], , -1

End Sub

Good luck,,,
 
Thanks for your response. My customers are already enjoying the convenience of automatic email from my application. I will now add in these additional features.

Sincerely,

Bill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top