vba - Outlook 2010 Running Rules on Outlook Data File -


I have used Thunderbird and now Outlook is running in 2010, PC is a Windows 7 Professional, 64 bit machine, but I use 32. Bit office 2010.

I have 8 email addresses, including 4 email addresses: all IMAPs are not an exchange server.

I believe that with IMAP, running email from the account inbox means that they are no longer on the server, so other devices can not see them anymore - to be corrected on this. P>

Thunderbird I do not copy all the emails to the local folder inbox, after that I have a folder structure under that local folder inbox, I click on a run rule button and it will be relevant to the sub folder (Not copies). As a result, in addition to spam and legal emails without a rule, the Inbox folder is emptied.

Outlook2010 I have a VBA routine that executes all the rules in the place and it works fine, I also have to trigger the button.

I created my Thunderbird set up by creating my folder structure under the Outlook Data File Inbox.

I have created a rule for each email account. All messages have been copied (not transferred) in that Outlook data file inbox.

I know that the rules should be made under each account and I believe that any outlook data can not be made in the file folder or sub rules in the folder.

However, if you go to the rule / alert then select run rule now you can select the rules to run and they will run on any folder, including any Outlook data file.

Essentially, I want to automate this process of running all the rules on the Outlook Data File Inbox.

I can not tell how to create the VBA code, select the Outlook Data File Inbox, then run just that rule of all data on the Outlook data file inbox.

Again, I believe this is necessary because if the Move Rule account runs through the email inbox, once the email accounts are transferred to the email inbox then they are none of them anymore. Can be seen on other devices.

I know that I can copy from each account's email inbox to the relevant sub folder and can not copy the first Outlook data file to the inbox, but that means that I still have all 8 email account inboxes Has to be regularly checked, if any important email is there for which I have not made any rules.

Any help would be appreciated.

> Nigel

I will not be able to help you with VBA but I Will allow the option to offer. Let me tell you first that it works for the Outlook data files you mentioned and any inbox mentioned by you. If you are familiar with VBA, then there should be no problem using my solution because the code is quite simple.

The complete solution has been described under.

You can review it and clone it with its free github.

Allow me to expand to make it more relevant I am using PowerShell to automate the Outlook and to create custom rules within the script.

You can use the following code to connect to Outlook Data Files:

  $ pstPath = "D: \ path \ to \ pst \ file.pst" Creating # Outlet Objects $ Outlook = New Object-COMBEJECT Outlook. App $ namespace = $ outlook. Gate namespace ("MAPI") # Getting the PST file was specified by PSTPATH ​​$ Pst = $ namespace? {$ _. File path-x $ pstPath} # root folder $ pstRoot = $ pst.GetRootFolder () #SUBFOLDERS $ pstFolders = $ pstRoot.Folders # Individual sub-personal $ $ pstFolders.Item ("personal")  

And you can create your own rule by changing the condition in the if statement:

  with specific e-mail in the title subtitle / # Under Randomom / PST file! DESTINATION FOLDER SPRINGFIELD INLINE ($ Email Subject -Match "TITLE" in specific STRING) {$ Email.Move ($ pstFolders.Item ("Random")).  

I am using the $ Email.Move method to move the email object from the PST file to the inbox, but if you want the $ Email.Copy . Of course you can also take emails between directories in the Outlook Data Store.

Hope it helps me know in case of any question I would be happy to help.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -