Results 1 to 9 of 9

Outlook VBA remove specific email address from ReplyAll message

Threaded View

  1. #1
    Registered User
    Join Date
    03-04-2015
    Location
    Lucas, IA
    MS-Off Ver
    2010
    Posts
    9

    Question Outlook VBA remove specific email address from ReplyAll message

    I am trying to remove a specific email address from the replyall using VBA macro. The following is my code

    Public Sub Response(Item As Outlook.MailItem)
    
    'Create an object to contain the original email
    Dim origEmail As Outlook.MailItem
    
    'Retain the original email
    Set origEmail = Item
    
    'Reply to everyone
    Set myResponse = origEmail.ReplyAll
    
    With myResponse
            'Remove the sender from the array of recipients
            .Recipients.Remove (1)
    
             'Remove specific email address
             For i = .Recipients.Count To 1 Step -1
            If LCase(.Recipients.Item(i).Address) = "junior@yahoo.com" Then
            .Recipients.Remove i
            End If
            Next
    
    
            'Add the the messsage
            
            'Attach the original e-mail
            .Attachments.Add origEmail
                        
            'Send the message
            .Send
    End With
        
    'Reset everything
    Set myResponse = Nothing
    Set origEmail = Nothing
    End Sub
    Any help would be appreciated why it doesn't remove the specific email address.
    Last edited by good4un2u; 03-04-2015 at 05:07 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Need Help with HTMLBody. Hyperlink email address and web address in body message VBA
    By Christopher Val in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-11-2015, 04:39 PM
  2. Using macro to find email address in address book of Outlook
    By danfullwood in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2014, 06:48 AM
  3. Outlook: How to set a specific group of members/email address
    By Ericng in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 07-10-2013, 05:07 AM
  4. Macro to PDF a sheet in workbook and email (outlook) to an email address in a cell
    By paul_sykes00 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-17-2012, 12:54 AM

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