So you've changed the project so that you want it to act on the currently open Outlook message, not one that the user would select from the Access form? In that case, it's much easier:

On Error Resume Next
Set objOL = CreateObject("Outlook.Application")
Set objItem = objOL.ActiveInspector.CurrentItem
If Not objItem Is Nothing Then
objItem.Save <path>, <type>
End If

<path> is the path string you'll create from your customer folder information and whatever you want to use for the name of the file.

<type> is the file type you want to use to save the message, as documented in Outlook Developer Help for the Save method. (Remember: The object browser is your friend. Be sure to add a reference to the Microsoft Outlook library to your Access project.)

Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54

"Peter" <Peter@discussions.microsoft.com> wrote in message news:B8F8EA22-2A51-42DA-BDB1-C3E8D5F4809A@microsoft.com...
> Thank you Sue,
>
> Unfortunately I am a bit unproficient in outlook vba and I'm not sure i get
> you right. Could you please be more specific. I provide more details:
> actually what i have is a list of customers stored in an access table. I will
> have a separate folder on the local hard drive for each client. The table
> will contain customer's name and the path to its associated folder. So can i
> use a code which will be trigerred by pressing the "Save as" button (or
> another button specially created for this purpose) and will open a list/combo
> box listing all customers prompting the user to choose a customer. When the
> user chooses a customer the code will save the currently opened message to
> the folder pointed by the path which corresponds to the chosen customer.
>

"Sue Mosher [MVP-Outlook]" <suemvp@outlookcode.com> wrote in message news:OEkSg2WoIHA.4760@TK2MSFTNGP06.phx.gbl...

This isn't a simple operation, because there's no easy way to present the data for the selection. You'd have to use the Outlook View Control, which has problems in Access 2007, or iterate the Inbox's Items collection and fill your own list box.

Once you figure out how you want to get over that hurdle, to copy a message to a local folder, you'd use the MailItem.SaveAs method.


"Peter" <Peter@discussions.microsoft.com> wrote in message news:FB10A15E-9E49-4886-9D12-69B36D703D26@microsoft.com...
> Hi, I am trying to manage some of my emails using a form in Access. So, what
> I need is to open my Access form, click a button, choose a message in my
> Outlook Inbox folder and copy it to a predefined folder on my computer. Does
> somebody know some piece of VBA code which can achieve this goal?
10 AprCopy an Outlook Email through Access.Peter
18 Apr\ Re: Copy an Outlook Email through Access.Sue Mosher [MVP-Outlook]
18 Apr   \ Re: Copy an Outlook Email through Access.Peter
18 Apr      \ Re: Copy an Outlook Email through Access.Sue Mosher [MVP-Outlook]
All times are in (US) Eastern Daylight Time (GMT -4:00)