Solved

Hardcode the reply address in an e-mail generated by MS Access.

Posted on 2006-11-07
4
570 Views
Last Modified: 2008-02-01
Hi All

I have a DB that is used by a few people that generates and e-mail and sends it to the one e-mail address. When that recipient replies, the reply will go to whoever sent the e-mail. Is there any way to hardcode one e-mail address that will always receive the replies?

An abridged version of my code is as follows;

Private Sub EmailFault_Click()

 'send e-mail
        Dim objOutlook As Outlook.Application
        Dim objOutlookMsg As Outlook.MailItem
        Dim objOutlookRecip As Outlook.Recipient
        Dim objOutlookAttach As Outlook.Attachment

        'create the Outlook session
        Set objOutlook = CreateObject("Outlook.Application")

        'create the message
        Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
   
        With objOutlookMsg
            'add the recipients to the message
   
            Set objOutlookRecip = .Recipients.Add("xxx@xx.com")  'send to the user
            objOutlookRecip.Type = olTo
         
            'set the subject and body of the message

            Dim Message As String
            Dim subject_line As String
   
            subject_line = "From xx"
             
            Message = "xx.         No:" & "   " & fault_number.Value & vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      "xx:" & vbCrLf & _
                      vbCrLf & _
                      junction_reference.Value & "          " & junction_address.Value & vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      "xx;" & vbCrLf & _
                      vbCrLf & _
                      fault_details_1.Value & " " & fault_details_2.Value & vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      "Reported by;" & "         " & reported_by_whom & "           " & date_reported & "     Fault reported at:   " & time_reported & vbCrLf & _
                      vbCrLf & _
                      vbCrLf & _
                      "xx." & vbCrLf

            .subject = subject_line
            .Body = Message

             
            '.Send
            .Display 'display the e-mail before sending
   
        End With

        Set objOutlookMsg = Nothing
        Set objOutlook = Nothing
       
End Sub

Is the ReplyRecipients Property relevant to this?

Thanks
Dakan
0
Comment
Question by:abaines
  • 3
4 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 125 total points
ID: 17888322
Yes. Give this addition a try:

        With objOutlookMsg
            'Add reply recipients
            .ReplyRecipients.Add   "addr@email.com"
            'add the recipients to the message
                         etc...
0
 
LVL 61

Expert Comment

by:mbizup
ID: 17888340
0
 

Author Comment

by:abaines
ID: 17889627
Thanks mbizup.

That did the trick.

Dakan
0
 
LVL 61

Expert Comment

by:mbizup
ID: 17889647
Glad to help :-)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

861 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