Solved

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

Posted on 2006-11-07
4
550 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

863 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now