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
|
|||
|
|||
How do I send informatin from the database to a contact?
Trying to setup a button to send information from the database to a contact.
Ex. If a contact requests information that is contained in the database, I want to be able to click on the contact in the database and it will send an e-mail to the contact with the information they requested. |
#2
|
|||
|
|||
How do I send informatin from the database to a contact?
Check Help for information about SendObject. You can add the appropriate
information to the subject line and/or the message body, as needed. Presumably you are clicking on a button or text box or something on a form. Is the contact e-mail address in the record from which you are clicking? If so, add that to the To argument, then add to the other arguments as needed for subject, message, and so forth, with commas as placeholders if you are not using the argument. This may be clearer when you look at the Help file. If you have further question, please provide specific information about such things as how Access is to determine the e-mail address, and where it gets the data to be included in the subject and/or message. "bsyalniz" wrote in message ... Trying to setup a button to send information from the database to a contact. Ex. If a contact requests information that is contained in the database, I want to be able to click on the contact in the database and it will send an e-mail to the contact with the information they requested. |
#3
|
|||
|
|||
How do I send informatin from the database to a contact?
"bsyalniz" wrote in message
... Trying to setup a button to send information from the database to a contact. Ex. If a contact requests information that is contained in the database, I want to be able to click on the contact in the database and it will send an e-mail to the contact with the information they requested. Here's some of my code from my website: http://www.datastrat.com/Code/OutlookEmail.txt Notice the following line: .body = "The body doesn't matter, just the attachment" Instead change it to: .body = Me.txtFirstName & " " & Me.txtLastName & vbCrLf & _ Me.txtAddress & vbCrLf & Me.txtCity & ", " & Me.txtState & _ vbCrLf & vbCrLf & Me.txtPhone substituting your control names, of course. Private Sub Command0_Click() 'Arvin Meyer 03/12/1999 'Updated 7/21/2001 On Error GoTo Error_Handler Dim objOutlook As Outlook.Application Dim objEmail As Outlook.MailItem Set objOutlook = CreateObject("Outlook.application") Set objEmail = objOutlook.CreateItem(olMailItem) With objEmail .To = " .Subject = "Look at this sample attachment" .body = "The body doesn't matter, just the attachment" .Attachments.Add "C:\Test.htm" '.attachments.Add "c:\Path\to\the\next\file.txt" .Send '.ReadReceiptRequested End With Exit_He Set objOutlook = Nothing Exit Sub Error_Handler: MsgBox Err & ": " & Err.Description Resume Exit_Here End Sub -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.mvps.org/access http://www.accessmvp.com |
Thread Tools | |
Display Modes | |
|
|