A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Store individual emails into an MS Access database



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 19th 07, 09:40 AM posted to microsoft.public.outlook.program_vba
hb21l5
external usenet poster
 
Posts: 3
Default Store individual emails into an MS Access database

pop3 mail, access 2003, outlook 2003,

I'm looking for a solution where I can export individual emails from Outlook
2003
direct into an MS access database

not all emails that go to that address want to go into the database, just
certain ones that I choose. I've searched for plugins to do this sort of
action without luck,

I'm not sure if I can open and read the PST file, but that would be a good
starting point if possible..

any ideas?

cheers
Dave

Ads
  #2  
Old September 19th 07, 05:34 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Store individual emails into an MS Access database

There's lots of options for reading Outlook data into databases. This page
has all the resources you need:

Connecting Outlook to Databases:
http://www.outlookcode.com/article.aspx?ID=25

This article has an example of pulling in data from an Exchange mailbox:

How to retrieve Exchange and Outlook data with the Jet 4.0 OLE DB provider
in Access 2000:
http://support.microsoft.com/?kbid=275262

A .pst can also be used as the datasource, but I'm not sure if it will work
in the context of the above article. You simply need to make a call using
the NameSpace.GetDefaultFolder method to retrieve a MAPIFolder object for
your Mailbox. Each MAPIFolder has an Items collection with all the messages.
Alternately, you can use the Explorer.Selection event to get just the items
that are currently selected in your active folder.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"hb21l5" wrote:

pop3 mail, access 2003, outlook 2003,

I'm looking for a solution where I can export individual emails from Outlook
2003
direct into an MS access database

not all emails that go to that address want to go into the database, just
certain ones that I choose. I've searched for plugins to do this sort of
action without luck,

I'm not sure if I can open and read the PST file, but that would be a good
starting point if possible..

any ideas?

cheers
Dave

  #3  
Old September 19th 07, 06:04 PM posted to microsoft.public.outlook.program_vba
hb21l5
external usenet poster
 
Posts: 3
Default Store individual emails into an MS Access database

Many thanks for the reply Eric,

I'm currently writing a plugin for outlook where I can right click an email,
select a Client name from a dropdown list (from my database). Then as soon as
i've managed to gather the info from the email (address, subject, body, etc)
I'll be able to use ADO to write them back to my Access Database

Set oAppt = Application.ActiveInspector.CurrentItem

I'm currently researching the above line to see if I can latch onto the
values I need.
Hopefully, it will work as expected and save me a load of money buying 3rd
party work arounds.

Do you know if this is the correct method of retreiving "sent to, from,
subject, body" from a currently selected email?

Sorry for all the questions, I Don't usually do much oOutlook Programming.

Thanks in advance

Dave


"Eric Legault [MVP - Outlook]" wrote:

There's lots of options for reading Outlook data into databases. This page
has all the resources you need:

Connecting Outlook to Databases:
http://www.outlookcode.com/article.aspx?ID=25

This article has an example of pulling in data from an Exchange mailbox:

How to retrieve Exchange and Outlook data with the Jet 4.0 OLE DB provider
in Access 2000:
http://support.microsoft.com/?kbid=275262

A .pst can also be used as the datasource, but I'm not sure if it will work
in the context of the above article. You simply need to make a call using
the NameSpace.GetDefaultFolder method to retrieve a MAPIFolder object for
your Mailbox. Each MAPIFolder has an Items collection with all the messages.
Alternately, you can use the Explorer.Selection event to get just the items
that are currently selected in your active folder.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"hb21l5" wrote:

pop3 mail, access 2003, outlook 2003,

I'm looking for a solution where I can export individual emails from Outlook
2003
direct into an MS access database

not all emails that go to that address want to go into the database, just
certain ones that I choose. I've searched for plugins to do this sort of
action without luck,

I'm not sure if I can open and read the PST file, but that would be a good
starting point if possible..

any ideas?

cheers
Dave

  #4  
Old September 19th 07, 06:40 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Store individual emails into an MS Access database

The CurrentItem property will actually return a different kind of object
depending on the item type (Mail, Contact, Appointment, etc.). So you need
to pass it to an Object variable or evaluate the CurrentItem.Class property
value to determine whether it's a valid object to cast to a typed variable
(like MailItem).

Once you get a MailItem object, access the .To, .Body, .Subject, etc.
properties to get the values you are looking for.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"hb21l5" wrote:

Many thanks for the reply Eric,

I'm currently writing a plugin for outlook where I can right click an email,
select a Client name from a dropdown list (from my database). Then as soon as
i've managed to gather the info from the email (address, subject, body, etc)
I'll be able to use ADO to write them back to my Access Database

Set oAppt = Application.ActiveInspector.CurrentItem

I'm currently researching the above line to see if I can latch onto the
values I need.
Hopefully, it will work as expected and save me a load of money buying 3rd
party work arounds.

Do you know if this is the correct method of retreiving "sent to, from,
subject, body" from a currently selected email?

Sorry for all the questions, I Don't usually do much oOutlook Programming.

Thanks in advance

Dave


"Eric Legault [MVP - Outlook]" wrote:

There's lots of options for reading Outlook data into databases. This page
has all the resources you need:

Connecting Outlook to Databases:
http://www.outlookcode.com/article.aspx?ID=25

This article has an example of pulling in data from an Exchange mailbox:

How to retrieve Exchange and Outlook data with the Jet 4.0 OLE DB provider
in Access 2000:
http://support.microsoft.com/?kbid=275262

A .pst can also be used as the datasource, but I'm not sure if it will work
in the context of the above article. You simply need to make a call using
the NameSpace.GetDefaultFolder method to retrieve a MAPIFolder object for
your Mailbox. Each MAPIFolder has an Items collection with all the messages.
Alternately, you can use the Explorer.Selection event to get just the items
that are currently selected in your active folder.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"hb21l5" wrote:

pop3 mail, access 2003, outlook 2003,

I'm looking for a solution where I can export individual emails from Outlook
2003
direct into an MS access database

not all emails that go to that address want to go into the database, just
certain ones that I choose. I've searched for plugins to do this sort of
action without luck,

I'm not sure if I can open and read the PST file, but that would be a good
starting point if possible..

any ideas?

cheers
Dave

  #5  
Old September 19th 07, 07:16 PM posted to microsoft.public.outlook.program_vba
hb21l5
external usenet poster
 
Posts: 3
Default Store individual emails into an MS Access database

Cheers Eric,

Thanks for all your help.

Dave



"Eric Legault [MVP - Outlook]" wrote:

The CurrentItem property will actually return a different kind of object
depending on the item type (Mail, Contact, Appointment, etc.). So you need
to pass it to an Object variable or evaluate the CurrentItem.Class property
value to determine whether it's a valid object to cast to a typed variable
(like MailItem).

Once you get a MailItem object, access the .To, .Body, .Subject, etc.
properties to get the values you are looking for.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"hb21l5" wrote:

Many thanks for the reply Eric,

I'm currently writing a plugin for outlook where I can right click an email,
select a Client name from a dropdown list (from my database). Then as soon as
i've managed to gather the info from the email (address, subject, body, etc)
I'll be able to use ADO to write them back to my Access Database

Set oAppt = Application.ActiveInspector.CurrentItem

I'm currently researching the above line to see if I can latch onto the
values I need.
Hopefully, it will work as expected and save me a load of money buying 3rd
party work arounds.

Do you know if this is the correct method of retreiving "sent to, from,
subject, body" from a currently selected email?

Sorry for all the questions, I Don't usually do much oOutlook Programming.

Thanks in advance

Dave


"Eric Legault [MVP - Outlook]" wrote:

There's lots of options for reading Outlook data into databases. This page
has all the resources you need:

Connecting Outlook to Databases:
http://www.outlookcode.com/article.aspx?ID=25

This article has an example of pulling in data from an Exchange mailbox:

How to retrieve Exchange and Outlook data with the Jet 4.0 OLE DB provider
in Access 2000:
http://support.microsoft.com/?kbid=275262

A .pst can also be used as the datasource, but I'm not sure if it will work
in the context of the above article. You simply need to make a call using
the NameSpace.GetDefaultFolder method to retrieve a MAPIFolder object for
your Mailbox. Each MAPIFolder has an Items collection with all the messages.
Alternately, you can use the Explorer.Selection event to get just the items
that are currently selected in your active folder.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"hb21l5" wrote:

pop3 mail, access 2003, outlook 2003,

I'm looking for a solution where I can export individual emails from Outlook
2003
direct into an MS access database

not all emails that go to that address want to go into the database, just
certain ones that I choose. I've searched for plugins to do this sort of
action without luck,

I'm not sure if I can open and read the PST file, but that would be a good
starting point if possible..

any ideas?

cheers
Dave

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail merge and Access database help. Malhyp Outlook - Using Forms 1 January 20th 07 02:55 PM
Access Database lordjeffj Outlook and VBA 2 June 28th 06 10:46 PM
Outlook contacts in Access Database Gunnarh Outlook - Installation 1 June 8th 06 12:23 PM
how do i create a database in access ogaz Outlook - General Queries 1 March 22nd 06 05:55 AM
"The specified default store could not be opened. Please make sure you can access your default store and try again." [email protected] Outlook - General Queries 2 February 17th 06 03:58 PM


All times are GMT +1. The time now is 12:26 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.