Solved

MS Outlook Move email to folder

Posted on 2016-10-14
2
75 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

861 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