Solved

MS Outlook Move email to folder

Posted on 2016-10-14
2
70 Views
Last Modified: 2016-11-28
Is there any way to setup a vb script in outlook to move specific email base on a specific  days of the week and time  without the account receiving a notification alert first.  I setup a  vb script that move the emails based on the criteria above but by the time it move the emails the user with this account get the alerts notifications.
0
Comment
Question by:Shen
2 Comments
 
LVL 69

Accepted Solution

by:
Qlemo earned 500 total points
ID: 41844966
The Application.NewMail Event will be triggered before rules and notifications are processed, so looks like the proper way to do it in Outlook VBA.
It does not work for offline (non-cached) Exchange profiles, though. And you need to search for the mail, as this is just a generic notification about new mail coming in, without having a reference to that mail. On the other hand, your VBS code should be similar already, and so you might be able to migrate that into the following:
Public WithEvents olApp As Outlook.Application

Public Sub Application_Startup()
  set olApp = Outlook.Application
End Sub

Private Sub olApp_NewMail()
   ' Now first check the time of day (and other criteria), then get the Inbox, and check the mail against the criteria.
End Sub

Open in new window

I prefer to use Items.ItemAdd (which is triggered by every single mail/object), but that might be called after rules.

A rule applied before any other rule is another way to directly trigger VBA code in Outlook. You can not trigger based on time, so you'll have to check the time and probably other contraints in VBA itself again. The pro with this is that you'Ve got the email (Item) object already as a parameter, like with ItemAdd.
0
 

Author Closing Comment

by:Shen
ID: 41904343
Thanks
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
To show how to generate a certificate request in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Servers >> Certificates…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

777 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