?
Solved

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

Posted on 2006-11-07
4
Medium Priority
?
595 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 61

Accepted Solution

by:
mbizup earned 500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
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…
Suggested Courses

801 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