Automatically move Outlook message to the specific folder when click on reply to all

Status
Not open for further replies.

manishc1989

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server 2013
I want if i recieved any outlook message from aspecific person. Firstly It comes directly in my inbox folder. But when i reply to the same message, then a script runs save that particular old message in the "Reply by me" folder of my outlook.

I donot know how to write that VBA script.
 

manishc1989

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server 2013
You could use the no script method... Quick Steps. Create one for reply & move.

It is possible to do things when reply is clicked, if you wanted all messages to be affected. I have a sample script here:
http://www.slipstick.com/developer/vba-when-reply-is-clicked/

I want to do it for only those outlook items which are recieved by the particular person or group.
For eg. when i reply to the email recieved by john kerry, old email would saved in the specific folder.
 

manishc1989

New Member
Outlook version
Outlook 2013 64 bit
Email Account
Exchange Server 2013
In the john kerry folder? and mail from mary contrary goes into the mark contrary folder? Blend the reply macro with the important bits of this macro - http://www.slipstick.com/developer/file-messages-senders-name/ - i'd actually recommend using the email address because display names may vary if they use multiple email clients or a smartphone to send mail.

While running this code it moves all inbox messages which are older than 4 days & create a seperate subfolder of it. Firstly i need it only for this email address automail@psc.com.
But It's doing for all the inbox messages. Secondly I've tried but not able to blend it with the reply macro. Kindly extend your help on the same.
Code:
Sub MoveAgedMail()
 
  Dim objOutlook As Outlook.Application
  Dim objNamespace As Outlook.NameSpace
  Dim objSourceFolder As Outlook.MAPIFolder
  Dim objDestFolder As Outlook.MAPIFolder
  Dim objVariant As Variant
  Dim lngMovedItems As Long
  Dim intCount As Integer
  Dim intDateDiff As Integer
  Dim strDestFolder As String
 
  Set objOutlook = Application
  Set objNamespace = objOutlook.GetNamespace("MAPI")
  Set objSourceFolder = objNamespace.GetDefaultFolder(olFolderInbox)
  
  For intCount = objSourceFolder.Items.Count To 1 Step -1
    Set objVariant = objSourceFolder.Items.Item(intCount)
    DoEvents
 
    If objVariant.Class = olMail Then
       intDateDiff = DateDiff("d", objVariant.SentOn, Now)
        ' I'm using 40 days, adjust as needed.
        If intDateDiff > 4 Then
       ' use your datafile name and each folder in the path
 
       ' the example uses an email address because Outlook 2010
       ' uses email addresses for datafile names
       sSenderName = objVariant.SentOnBehalfOfName
If sSenderName = "automail@psc.com" Then
  sSenderName = objVariant.SenderName
   End If
On Error Resume Next
Set objDestFolder = objSourceFolder.Folders(sSenderName)
  If objDestFolder Is Nothing Then
    Set objDestFolder = objSourceFolder.Folders.Add(sSenderName)
       End If
            objVariant.Move objDestFolder
            'count the # of items moved
            lngMovedItems = lngMovedItems + 1
            Set objDestFolder = Nothing
        End If
        End If
 
  Next
   ' Display the number of items that were moved.
   MsgBox "Moved " & lngMovedItems & " messages(s)."
 
  Set objOutlook = Nothing
  Set objNamespace = Nothing
  Set objSourceFolder = Nothing
End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
A How to move responded emaisl automatically to sub folders in Outlook 2007 Using Outlook 0
E Automatically move to other Folder from Inbox when mail comes - MS Outlook Using Outlook 1
P Outlook folder path changing automatically when move or delete Item from custom task folder which is installed in Exchange 2010 sared mailbox Using Outlook 1
J Automatically Move Old Items from a Shared Mailbox to a .PST on a Network Drive Outlook VBA and Custom Forms 1
S Automatically move recipients to BCC field Using Outlook 3
S how automatically move messages after they've been read to a particular folder Using Outlook 1
diver864 vba for a rule to automatically accept meeting requests with 'vacation' in subject, change to all-day event, change to free, don't send reply Outlook VBA and Custom Forms 1
D Custom Search Folders not refreshing/updating automatically Using Outlook 0
M Automatically add senders first name to a greeting Outlook VBA and Custom Forms 1
C Add Form to Appointments Received, Automatically Outlook VBA and Custom Forms 6
J Automatically forward email and apply template Outlook VBA and Custom Forms 0
Y Outlook 2013 Stop Outlook from automatically assigning categories to Tasks Using Outlook 0
O Forward a email with modified body Automatically. Outlook VBA and Custom Forms 0
A How to open a specific link automatically with outlook 2016 Outlook VBA and Custom Forms 6
P Automatically Categorize Meetings once they are accepted Outlook VBA and Custom Forms 5
W Automatically open attachments without automatically printing them Using Outlook 0
N How to set automatically the default or user defined Quickstyle Templates by Answer in Outlook Using Outlook 1
O Run macro automatically at sending an email Using Outlook 11
D Outlook 2016 automatically increment anniversaries Using Outlook 1
T Office 2013 no longer updating automatically Using Outlook 2
B Automatically Forward Emails and Remove/Replace All or Part of Body Outlook VBA and Custom Forms 8
D Print attachments automatically and moves the mail to a new folder Outlook VBA and Custom Forms 9
A How to open a specific link automatically with outlook Outlook VBA and Custom Forms 13
L Automatically Insert Recipient Name from To Field Outlook VBA and Custom Forms 33
N how to sync automatically when outlook opens Using Outlook 10
A Sort emails into subfolders based on sender and deleting emails automatically Outlook VBA and Custom Forms 3
undercover_smother Automatically Forward All Sent Mail and Delete After Send Outlook VBA and Custom Forms 10
C Need VBA code to automatically save message outside outlook and add date Outlook VBA and Custom Forms 1
stephen li VBA Outlook send mail automatically by specified outlook mail box Outlook VBA and Custom Forms 1
R Make Enter Network Password Prompt Go Away Automatically Using Outlook 0
I Print Automatically Attachments Outlook VBA and Custom Forms 3
S Automatically selecting folders and deleting messages in Outlook VBA Outlook VBA and Custom Forms 7
M Outlook 2016 Rules Not Working Automatically Using Outlook 5
Diane Poremsky Automatically create a task when sending a message New Slipstick.com Articles 0
D Is it possible to automatically send an email when it is moved to a folder? Exchange Server Administration 1
A Automatically send email based on drop-down field? Outlook VBA and Custom Forms 2
M Automatically create event in calendar when task is created Outlook VBA and Custom Forms 1
Diane Poremsky Create Appointment From Email Automatically New Slipstick.com Articles 0
Cameron Piper Automatically update custom forms across multiple computers Outlook VBA and Custom Forms 1
T Automatically open link in email received Outlook VBA and Custom Forms 33
N Automatically file email messages Using Outlook 2
M Change default "automatically test account settings when Next is clicked" Using Outlook 1
D Automatically file message and reply to folder. Using Outlook 1
A Code to automatically delete message after sending Outlook VBA and Custom Forms 6
Diane Poremsky Automatically Create Contacts From Messages New Slipstick.com Articles 1
T Outlook 2010 emails do not refresh automatically Exchange Server Administration 1
L Save Mail Message to new folder created automatically Outlook VBA and Custom Forms 1
G Hae Rules NOT perform automatically? Using Outlook 1
F Automatically close email after selecting mark unread Using Outlook 1
nathandavies How to save emails to a specific folder on a network automatically using a macro Outlook VBA and Custom Forms 14

Similar threads

Top