Solved

MS Outlook Move email to folder

Posted on 2016-10-14
2
90 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 70

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
Check out this step-by-step guide for using the newly updated Experts Exchange mobile app—released on May 30.
This video discusses moving either the default database or any database to a new volume.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

705 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