Selected CC address move to Selected folder in office 365 outlook - vba

I want move selected cc address to selected folder in outlook office 365 (Using rule or VBA script)
Ex- Received one email from "abc#zyz.com" and in this mail "xyz#abc.com" is in CC.
So i want move xyz#abc.com to "Purchase-Dept" folder.

First of all, Outlook rules and VBA macros can be run in the Outlook desktop only.
You can set up a rule in Outlook or create a VBA macro. Your VBA macro can also be called from a rule if it triggers and should look in the following way:
Public Sub Test(mail as MailItem)
' here your actions
End Sub
Also you can implement the required functionality in VBA only. For that you need to declare a method where you could check the To and Cc properties of Outlook items. But better yet is to use the Recipients property for checking such fields. Be also aware that Outlook folders may contain different kind of items, so I'd recommend checking the item's MessageClass property which returns or sets a string representing the message class for the Outlook item, see Item Types and Message Classes for more information about their correspondence.

Related

Saving Outlook Attachments Automatically Based On Attachment File Name Only

I need to save an Outlook file attachment with a static file name to a specific network location automatically when that email arrives. This file will be saved in a network location for upload using a monthly SSI server package. I hope to do this automatically without any interaction but not opposed to manually running a macro. I am unsure of references that are needed in VBA to get this to execute. I am also unfamiliar with the "ThisOutlookSession" configuration that I've seen in similar threads
I have attempted to use the existing script that I've seen here with no luck. ( I can get them to run without error but do not get any results ) I want to search all incoming email and only have it take action if the email has an attachment and that attachment has a specific unchanging file name. I have the developer tab enabled in Outlook and can access VBA through it. Looking for a solid simple solution. Constants are the file name and extension as well as the network folder. Variables would be the sender and date of delivery. Office 365 running Windows 10 in a professional environment. Any help or direction would be greatly appreciated.
You can handle incoming emails in Outlook in the NewMailEx event handler. The event fires once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem, MeetingItem, or SharingItem. The EntryIDsCollection string contains the Entry ID that corresponds to that item. Use the Entry ID string to call the NameSpace.GetItemFromID method and process the item. The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs.
Also, as a possible workaround, you may consider handling the ItemAdd event on the Inbox folder. This event is fired when one or more items are added to the specified collection. This event does not run when a large number of items are added to the folder at once. For example:
Public WithEvents myOlItems As Outlook.Items
Public Sub Application_Startup()
Set myOlItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items
End Sub
Private Sub myOlItems_ItemAdd(ByVal Item As Object)
MsgBox Item.Attachments.Count
End Sub

Moving Emails to specific Outlook folders Using Access VBA

I'm using Microsoft Office 2013 to set up an access database linked to an inbox in outlook. I'm having no issues setting up a linked table and manipulating the data within access.
What I want to do is move the email from one outlook folder/subfolder to another outlook folder/subfolder with VBA code within Access. In other words, I want to click on a button within Access and activate VBA coding that moves the email within Outlook.
Any tips on how to get started will be greatly appreciated.
Use MailItem.Move and pass the target MAPIFolder object as the parameter.

VB Script for Outlook to automatically copy the file contents to a designated folder with a particular sender or based on Subject?

I am a newbie to VB Scripting, what I have been trying to do is as soon as i receive a mail in Outlook from a particular sender or a particular message in the Subject line, I should copy the contents of the specified File location to other specified location
Is this feasible?
Yes, it can be implemented using VBA macros or creating an Outlook add-in. You can handle the NewMailEx event of the Application class where you can check out the Subject property and do whatever you need. See Getting Started with VBA in Outlook 2010 in MSDN for more information.

SharePoint 2010 Email Outlook File to Library with attachments embedded

The only way I have found to retain attachments with an email from Outlook to SharePoint is to do a save as .msg and drag and drop into the SharePoint library.
I would like to set the library to receive email and retain the attachment as part of the email. I don't want the attachments to separate from the email when they arrive in the library.
Is there an add-in to Outlook or a fix in SharePoint 2010??????
You have two options:
1. Stick with the SharePoint options like adding attachments to the library or to a sub folder of the library based on subject or sender.
2. Write a custom email event handler. Here is an example for 2007, but it should work in 2010 as well: http://blogs.msdn.com/b/malag/archive/2009/05/13/attachments-disappear-with-custom-email-event-handler.aspx
marco
Marco, when I created the EventHandler to try and retain the message and attachment when activated it still came through as it was before by separating the message and attachment in two different files
Yes there are add-ins. I have used some 3rd Party tools for Outlook and SharePoint:
Scinaptic's OnePlaceMail
Colligo
Macroview
They are all good.

Dynamically add sender email to Message Header rule in Outlook 2007 via right-click

I would like VBA code for Outlook 2007 to right-click a message in any mail view, choose a rule to add it to, and have the sender email be added to the Message Header contains value for that rule.
Only particular rules use Message Header as a criteria, so only those applicable rules should show when I right-click a message.
With a little effort, you are able to manipulate the context menu with VBA.
Any Outlook version prior to 2007 has no object model for rules.
But since OL2007, each Store object exposes GetRules() method, which returns a Rules collection. Try to iterate that collection and fill a CommandBarPopup object with all the rules you want. The Rule objects can be manipulated, so in theory you should be able to do the job.