Opening an existing message from a database query

J

Jon C

Using an SQL database (and lets say hypothetically MS access) and Outlook 2007.

What is the easiest way to automatically associate an email with the database?

The email subject lines will all be static and contain a USER_ID and MONTH field.

The same USER_ID and MONTH is also present in the database.

Provided both programs are open... Is it best to design a query that pulls the USER_ID and MONTH field out of the database and sends a command to Outlook to open all emails with subject lines that match this USER_ID and MONTH?

I'm open to any suggestions.. What is the best/easiest way to accomplish this automation? Any links provided would be greatly appreciated. .
Submitted using http://www.outlookforums.com
 
M

Michael Bauer [MVP - Outlook]

With the Restrict or Find functions you can find items, for instance by
Subject, in a folder. But you need to know the folder or loop through every
possible folder.

An alternative would be to use the StoreID and EntryID. With that, and
provided that the message won't be moved, you can get it with the
GetItemFromID function.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Tue, 18 Aug 2009 19:00:25 -0400 schrieb Jon C:
Using an SQL database (and lets say hypothetically MS access) and Outlook 2007.

What is the easiest way to automatically associate an email with the database?

The email subject lines will all be static and contain a USER_ID and MONTH field.

The same USER_ID and MONTH is also present in the database.

Provided both programs are open... Is it best to design a query that pulls
the USER_ID and MONTH field out of the database and sends a command to
Outlook to open all emails with subject lines that match this USER_ID and
MONTH?
I'm open to any suggestions.. What is the best/easiest way to accomplish
this automation? Any links provided would be greatly appreciated. .
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top