简体   繁体   中英

Search email in Outlook for Customer ID, forward email to email address in database

Sorry, complete noob here... we have a client that has a list in Excel of 1,500 customers with their Customer ID and their email address.

As an invoice email comes into a mailbox they want a way to search the email body for the Customer ID and then forward to the email address in the Excel spreadsheet.

It doesn't have to be Excel, but it has to be simple enough for an end user to add to the list in the future.

Can this be done with VBA to search a database from Outlook, or do I need to look at a third party program? If the latter, can anyone recommend one?

Yes, it is possible to implement such things according to your needs. You can create a VBA macro or develop a COM add-in if you need to distribute the solution on multiple machines. In case of VBA the starting point is to get familiar with the environment, see Getting started with VBA in Office .

You need to start from handling incoming emails, so the Application.NewMailEx can be helpful in that case. This 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 NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. The EntryIDsCollection string contains the Entry ID that corresponds to that item. Use the Entry ID to call the NameSpace.GetItemFromID method and process the item.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM