Move mails via macro triggered by the click of a button?

Eike

Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
Hi everyone,

i am looking for a macro that will move mails to a specified folder triggered by the press of a button.
There seem to be a lot of macros doing what i want automatically when a mail arrives but i need to trigger it manually.

Situation:
I receive lots of mails from monitoring and ticket systems. I need to look at the Subject line before i move them.
Of course i could create a rule, move them to subfolders and check the subfolders but that has proven unusable. I just don´t check the subfolders often enough over the day no matter how hard i try and might miss important mails for hours.

Solution i am looking for:
- categorize incoming mails via Outlook rule
- macro tied to a button that
- goes through the inbox
- looks for mails of category x
- move mails of category x to a subfolder
- (optional) marks them as read along the way

I´m really no good at vba. So i was unable to glance at some scripts and just deduct how to change them to do what i need here.

Code:
Sub MoveMailToFolder()

  Dim Messages As Selection
  Dim Msg As MailItem
  Dim NSpace As NameSpace

  Set NSpace = Application.GetNamespace("MAPI")
  Set Messages = Item.restrict category blue                         <-- syntax wrong, but the general idea would be to create a selection of all mails from category x

  If Messages.Count = 0 Then
    Exit Sub
  End If

  For Each Msg In Messages
    Msg.Move NS.Folders("Archiv").Folders("MonitoringMails")
  Next

End Sub

I would be really happy if someone could help me out. Also if you have an idea how to do this even without a marco.
I found no way to do this with rules and quick actions without having to do a lot of clicks every time. So really every solution with or without a macro would be great.

Thank you for looking at this post and maybe having an idea about it.

Have a good day everyone,
Eike
 
Similar threads
Thread starter Title Forum Replies Date
P when i move inbox mails to another folder in outlook the mail disappears Using Outlook 1
F Move mails from Deleted Items folder back to its original folder where the mails got deleted Using Outlook 0
L Move E-Mails to Another Folder Using Outlook 66
P move mails after send to central mailbox-sent items folder Using Outlook 4
S auto move mails from mailboxes to public folders Exchange Server Administration 6
GregS Outlook 2016 Move Outlook to new computer? Using Outlook 4
witzker Macro to move @domain.xx of a Spammail to Blacklist in Outlook 2019 Outlook VBA and Custom Forms 7
G Move tasks up/down todo list by VBA Outlook VBA and Custom Forms 1
S Macro to move “Re:” & “FWD:” email recieved the shared inbox to a subfolder in outlook Outlook VBA and Custom Forms 0
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
D Move Email with Attachment to Folder Outlook VBA and Custom Forms 3
G Cannot Move Autocomplete File to New Computer Using Outlook 15
M Move to Folder Using Outlook 1
P Move emails between 2 mailboxes. Using Outlook 0
C Copy Move item won't work Outlook VBA and Custom Forms 2
N Macro to move all recipients to CC while replying Outlook VBA and Custom Forms 0
Commodore Move turns into "copy" Using Outlook 3
R List folders in a combo box + select folder + move emails from inbox to that folder + reply to that email Outlook VBA and Custom Forms 1
Jennifer Murphy Ctrl+Tab sometimes will not move through text a word at a time Using Outlook 1
V Outlook 2016 will not move emails in search results Using Outlook 4
M move to iCloud not working in outlook calendar Using Outlook 12
A Create date folder and move messages daily Outlook VBA and Custom Forms 1
Commodore Folders always closed in move/copy items dialog box Using Outlook 3
C Move Outlook 2007 to new PC with Outlook 365 Using Outlook 3
C Can't move folder, the folder is full Using Outlook 0
Nadine Rule to move attachments with specific name Outlook VBA and Custom Forms 1
A Move email items based on a list of email addresses Outlook VBA and Custom Forms 40
T Move calendar invites to new calendar Using Outlook 5
O Rule to move (specific) messages from Sent folder to Specific folder Using Outlook 1
I Automating message move between folders Outlook VBA and Custom Forms 0
K Outlook Rules: Move a Copy Using Outlook 4
K VBA BeforeItemMove event create rule to always move to its folder. Outlook VBA and Custom Forms 4
N Move emails of same conversation to same subfolder Using Outlook 6
Peter H Williams How to Move Mail item after processing Outlook VBA and Custom Forms 5
D Move Emails between Folders in Separate Mailbox Outlook VBA and Custom Forms 12
E Search for folder by key in subject then move new message to related folder Outlook VBA and Custom Forms 1
I Outlook 2013 Any way to move .OST file to new system? Using Outlook.com accounts in Outlook 5
O On click,I want to change subject line of selected mail and then reply to particular email and move Using Outlook 3
F "Move to" O365 feature to Outlook client via VBA Outlook VBA and Custom Forms 4
B Macro to manually move selected emails to network folder Outlook VBA and Custom Forms 1
L Making rule to move email to folder from one O365 domain Using Outlook 1
B Copy/Move Exchange inbox to Pop inbox Using Outlook 4
S Send email via SMTP - use transport rules to add to senders inbox (then rule to move to sent items Exchange Server Administration 1
C Move from Outlook 2007 Enterprise (MOE) to Outlook Pro plus 2007 Using Outlook 1
Cdub27 Move Outlook 2016 Contacts to Other Folders - Extremely Slow !! Using Outlook 6
M code to move selected Outlook contacts to another folder Using Outlook 3
Mark White VBScript Move sent mail to non-default folder Outlook VBA and Custom Forms 5
Mark White VBScript Move sent mail to non-default folder Outlook VBA and Custom Forms 0
G Favorites panel entries move around after restarting Outlook 2016 Using Outlook 1
M Move new mail to folder based on sender address Outlook VBA and Custom Forms 2

Similar threads

Top