Sounds like you have two steps
1) Save the MailItem as an external file (.msg)
2) Grab the path to the .msg file and save it in the Access Database.
The Outlook View Control ActiveX control provides users with the ability to
view the contents of Outlook folders from applications like Access. You could
create code that looks at the selection in the Explorer, saves the file and
then captures the file path in the database.
The user will open the Access form with the OVC, click on the MailItem to
selecte it and then *click on a button on your Access form* to save it.
You'll have to create you're own SAVE function in order to capture the path
as you won't be able to do so using the one in Outlook.
The Explorer object in the Outlook Object Model exposes a .Selected property
which can be used to grab the items selected by the user. I've never worked
with the Outlook View Control within Access so I don't know how you reference
the property from within Access, but it should be entirely doable.
I would start by developing code in Outlook that takes the SelectedItem in
an Explorer and saves it to disk returning the path of the location. You can
certainly build this within Outlook to shake down the bugs before you add it
to Access.
When you do start building in Outlook, you'll be building a Sub that handles
saving the item as opposed to using the Save/Save As functionality in Outlook
on the menu.
The logic will essentially be...
-Open the Windows Open/Save Common Dialog to get the location where the
files should be saved
-Loop through the selected items in the explorer
-Save the file using the .SaveAs method
-Update the underlying table in access or create a new record
The link below will show you how to use the Windows Open/Save Dialog to
enable the user to navigate the file system and return the selected path. You
shouldn't have any problems dropping the code into Outlook.
The next article will show how to work with the items Selected in an
explorer. Saving the item as a .msg file is just a matter of calling the
..SaveAs method of the item once you have a reference to it.
http://www.microsoft.com/office/com...soft.public.outlook.program_vba&lang=en&cr=US
(Scroll down to the 'Selection method' topic 4/5ths of the way down)
http://support.microsoft.com/default.aspx/kb/313800
The article is aimed at VB.NET however it does cover the basic objects and
methods that you'll need to get at the selected items. It can't be used
as-is, but you should be able to easily adapt it.
Finally, the Outlook newsgroup is the best place for help with all things
related to Outlook.
http://www.microsoft.com/office/com...soft.public.outlook.program_vba&lang=en&cr=US
http://www.microsoft.com/office/com...soft.public.outlook.program_vba&lang=en&cr=US