+ Reply to Thread
Results 1 to 5 of 5

Reply to Email through Excel VBA

Hybrid View

aaron.mendes Reply to Email through Excel... 05-23-2014, 11:16 AM
Tinbendr Re: Reply to Email through... 05-23-2014, 06:09 PM
aaron.mendes Re: Reply to Email through... 05-26-2014, 04:34 AM
Tinbendr Re: Reply to Email through... 05-26-2014, 07:36 AM
aaron.mendes Re: Reply to Email through... 05-26-2014, 07:52 AM
  1. #1
    Registered User
    Join Date
    07-01-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    66

    Reply to Email through Excel VBA

    Hi,

    I have a code to create new emails and send through VBA. PLease see below.
    However, I am new to VBA and have searched everywhere for a code that would help in replying to emails through VBA.
    I have many emails and my reply is more or less standard. Is there a code, where i can 1) select the email that i want to reply, 2) pick up the body of the email from my excel file (designated Range/cell) and 3) send out the email to the recipient?

    Your help would be much appreciated.

    Sub Test1()
    
        Dim OutApp As Object
        Dim OutMail As Object
        Dim cell As Range
    
        Application.ScreenUpdating = False
        Set OutApp = CreateObject("Outlook.Application")
    
        On Error GoTo cleanup
        For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
            If cell.Value Like "?*@?*.?*" And _
               LCase(Cells(cell.Row, "C").Value) = "yes" Then
    
                Set OutMail = OutApp.CreateItem(0)
                On Error Resume Next
                With OutMail
                    .To = cell.Value
                    .Subject = Cells(cell.Row, "D").Value
                    .Body = Cells(cell.Row, "E").Value
    
                    'You can add files also like this
                    '.Attachments.Add ("C:\test.txt")
                    .Send  'Or use Display
                End With
                On Error GoTo 0
                Set OutMail = Nothing
            End If
        Next cell
    
    cleanup:
        Set OutApp = Nothing
        Application.ScreenUpdating = True
    End Sub

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Reply to Email through Excel VBA

    And how does this code not work for you?
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    07-01-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: Reply to Email through Excel VBA

    Hi David - this code is for composing new emails. And what i am looking for is a reply to emails that hits my inbox.

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: Reply to Email through Excel VBA

    So, let me see if I understand. When you get an email, you want to reply with a certain fixed reply based on the one who sent it?

    I do something similar. I have to send in a 'request'. This request is the always the same, except for PO# and a couple of phrases.

    As far as your request 1), 2), & 3), those are all possible. I recommend writing this in Outlook, and getting the data from Excel.

    I am also going to recommend that you repost this in the Outlook forum and post a link back to this message. I am not that well versed in Outlook and a solution from me might take a long time.

  5. #5
    Registered User
    Join Date
    07-01-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    66

    Re: Reply to Email through Excel VBA

    Yes, you guessed it right. However, I will post this in the outlook forum. Thanks for your help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Search Email And Add Reply To It
    By hecgroups in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-22-2014, 11:28 PM
  2. [SOLVED] Reply ALL email from excel Range will not CC or Bcc original recipients
    By sonny.thind in forum Outlook Programming / VBA / Macros
    Replies: 0
    Last Post: 06-27-2013, 09:32 AM
  3. Using Excel VBA Macro to Reply to email in Outlook
    By thechancellor in forum Excel General
    Replies: 0
    Last Post: 06-19-2012, 09:40 PM
  4. [SOLVED] Reply to outlook email from excel script
    By theerdman@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-21-2006, 12:00 PM
  5. control outlook to reply to email
    By as_sass in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-04-2005, 05:32 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1