Importing Emails from an Exchange Email box

Hi,

I am currently (manually) importing emails into my DB.

I am only importing the following fields from each mail item:

1) Receive Date
2) From
3) Subject
4) Body

I would like to automate this process with code - so that the user click a 
button and the fields above are imported into a table called 'Daily Results', 
with field names the same as 1,2,3 and 4 above.

Can anyone advise of how to do this?  I thought MS Access had an 'Import 
Builder' where these setting could be saved, and recalled when required (like 
a Macro) but I cannot seem to find this.

Any help would be greatly appreciated.

Cheers,
GLT.
0
Utf
2/27/2008 12:15:01 PM
access 16762 articles. 2 followers. Follow

1 Replies
781 Views

Similar Articles

[PageSpeed] 52

Hi,

After some searching high and low I cam up with the following code which 
copies all emails from an Outlook folder called "ResultsFolder" to an Access 
Table called "ResultsTable".

The following feilds cre copied from each email:

Received
From          
Subject     
Body 


Sub ImportEmailsFromOutlook()

   ' This code is based in Microsoft Access.


   Dim rst As DAO.Recordset
   Set rst = CurrentDb.OpenRecordset("ResultsTable")

   ' Set up Outlook objects.
   Dim ol As New Outlook.Application
   Dim olns As Outlook.Namespace
   Dim c As Outlook.MailItem
   Dim objItems As Outlook.Items
   Dim objFolder As Outlook.MAPIFolder
   
   ' Set up varibles
   Dim iNumEmails As Variant
   Dim i As Variant
   Dim FolderName As Variant

 
   
   FolderName = "ResultsFolder"
   Set olns = ol.GetNamespace("MAPI")
   Set objFolder = olns.GetDefaultFolder(olFolderInbox).Folders(FolderName)
   Set objItems = objFolder.Items

   
   Forms![frm_MainMenu]![Status] = "Importing Message Email Messages"
   
    iNumEmails = objItems.Count
    If iNumEmails > 0 Then
      For i = 1 To iNumEmails
            Set c = objItems(i)
            testDate = c.ReceivedTime
            todayDate = Date
                                    
                     
               Forms![frm_MainMenu]![Status] = "Importing Message: " & 
c.Subject

               rst.AddNew
               rst!Received = c.ReceivedTime
               rst!From = c.SenderEmailAddress
               rst!Subject = c.Subject
               rst!Body = c.Body
               rst.Update
              
            
      Next i
      rst.Close
      MsgBox "Finished."
    Else
      MsgBox "No emails to export."
    End If
   
End Sub

"GLT" wrote:

> Hi,
> 
> I am currently (manually) importing emails into my DB.
> 
> I am only importing the following fields from each mail item:
> 
> 1) Receive Date
> 2) From
> 3) Subject
> 4) Body
> 
> I would like to automate this process with code - so that the user click a 
> button and the fields above are imported into a table called 'Daily Results', 
> with field names the same as 1,2,3 and 4 above.
> 
> Can anyone advise of how to do this?  I thought MS Access had an 'Import 
> Builder' where these setting could be saved, and recalled when required (like 
> a Macro) but I cannot seem to find this.
> 
> Any help would be greatly appreciated.
> 
> Cheers,
> GLT.
0
Utf
2/29/2008 12:18:01 AM
Reply:

Similar Artilces:

Remote VPN access to Exchange
We have a user who is remotely connecting to our network via VPN through a Cisco PIX firewall. She can access network resources no problem, but when she tries to configure Outlook using our Exchange server, it keeps asking for authentication. Using her windows account information does not work. How do we get past this? Thanks. Is she actually authenicating in the domain or is she using cached credentials? It seems unusual that authentication would work for network resources for not for Exchange. What type of network resources is she asking and is she actually logging onto the domain...

Importing messages #6
I have a backup disk that I would like to impport from, but obviously I do not know how. When I double-click a message, it does not recognize which program to use to open it and takes me to an MS site. All of these have a ..dbx extension. Thank you. "Jennifer" <Jennifer@discussions.microsoft.com> wrote in message news:3398C3D3-FDD8-41CB-8F73-C445B56F6CF7@microsoft.com... >I have a backup disk that I would like to impport from, but obviously I do > not know how. When I double-click a message, it does not recognize which > program to use to open it and takes me...

Import and export
Trying to salvage my data and it was suggestd I import and export files, do I need to import and export closed accounts as well? Only if you want them in the new file. In order to export a closed account, you'll need to first specify that it is open in Money. "Mike" <anonymous@discussions.microsoft.com> wrote in message news:269701c3fc78$9f29fcf0$a301280a@phx.gbl... > Trying to salvage my data and it was suggestd I import and > export files, do I need to import and export closed > accounts as well? ...

Looking for a way to enable exchange 2k with spam blocking
Does anyone know of a good way to enable exchange 2k with spam blocking? anon wrote: > Does anyone know of a good way to enable exchange 2k with spam blocking? The simple way should be to use or install an anti- "virus/spam" solution as Antigen... Bye -- Thierry DEMAN-BARCEL´┐Ż MVP Exchange,SQL/Server,[MCSE option Messaging, MCSA 2003]. "anon" <jkit001@yahoo.com> wrote: >Does anyone know of a good way to enable exchange 2k with spam blocking? You can get the same stuff that E2K3 does by installing Open Relay Filter (http://www.vamsoft.com/orf). -- Ri...

Importing data
When I import sales data through 3CDaemon, I get cells that I of data that I cannot use in formulas. It is like they are corrupted. But can copy the info from cell to cell, just cannot use in formula (ex. =if(dd04="N",1,0. Formula does not error out, but it makes no difference if N, U, or anything else is in dd04. It answers back 0. How can I fix this ? Just a couple of guesses (I have no idea what 3CDaemon is). First, Get a copy of Chip Pearson's CellView Addin so that you can really determine what's in DD04): http://www.cpearson.com/excel/CellView.htm Second, ...

Import TransferIN into TransferOUT... its possible?
Hi, I have RMS 1.3, its possible to import a transfer in of one store into transfer out on my store? Thanks in advance. Aldo, If you are running HQ, it does this for you, on the next connect to HQ. -- * Get Secure! - www.microsoft.com/security You must be using Outlook Express or some other type of newsgroup reader to see and download the file attachment. If you are not using a reader, follow the link below to setup Outlook Express. Click on "Open with newsreader" under the MS Retail Management System on the right. http://tinyurl.com/75bgz ********** "Aldo" <...

Not Receiving Email from Some Known Senders
Hi. I just got a new home PC from Dell. I am using Outlook 2003. I am also running McAfee Security Center. I am not receiving email from some senders that I know. They are not going to my Junk Email folder or my McAfee Anti-Spam folder. One sender whose email I am not receiving is my husbands. He is getting a message back from his postmaster that says "Delivery is delayed to these recipients...This message has not been delivered. Microsoft Exchange will continue to try delivering the message on your behalf." Even he sends an email to a distribution list and I am in the ...

excel 97 xml import
I have Excel 97 and need to import a XML file. I don't know vba. Slinger XL97 was written way before XML therefore it will not handle it. Only XL2003 (Individual product or from Office Pro) will recognise and handle XML import/export -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England nick_hodgeTAKETHISOUT@zen.co.uk.ANDTHIS "Slinger" <Slinger@discussions.microsoft.com> wrote in message news:D1D9952E-F741-4B11-8040-B27B34F382BE@microsoft.com... >I have Excel 97 and need to import a XML file. I don't know vba. ...

OWA Access denied to domain users Exchange 2000
Hi I have set up a new virtual directory to access the mail from OWA for the domain abc.com. When I type the OWA URL I get the prompt. I try user A@abc.com and it works. Then I try user B@abc.com and it denies access. I am at a loss to understand why some users in the domain can log in to OWA and some users can't. I'd appreciate any help in this matter. Thanks & Regards Any help? soup_or_power@yahoo.com wrote: > Hi > I have set up a new virtual directory to access the mail from OWA for > the domain abc.com. When I type the OWA URL I get the prompt. I try > user A@abc...

How I import data without truncating zero in the beginning
I am importing data from text file to access database but it is truncating all the zeros if they come in the starting.... please help me to resolve this problem as there is a field name telephone number and I need zero in the starting to distinguish between local and international calls. Remplace them by "+" (normaly it's the same) "Mohsin Habib" <MohsinHabib@discussions.microsoft.com> a écrit dans le message de news:8B32A18C-E88B-4259-8CAE-332EB821883C@microsoft.com... >I am importing data from text file to access database but it is truncating > ...

PUBLISHER TEXT BOX PROBLEMS
HOW DO I MAKE THE BACKGROUND OF A TEXT BOX BLACK AND THE WRITING WHITE? I CAN ONLY SEEM TO MAKE THE WHOLE PAGE BLACK. Three steps are needed. #1 Replace or fix your keyboard so it isn't stuck on Caps Lock. #2 Select the text frame and then color it black. #3 With the text frame selected, use Ctrl-A to highlight all text and click on the text color icon to choose white. -- Ron "cataloguemaker" <cataloguemaker@discussions.microsoft.com> wrote in message news:CCAF0C9F-1FE2-4A76-9431-CCB37FFCFF68@microsoft.com... > HOW DO I MAKE THE BACKGROUND OF A TEXT BOX BLACK AND ...

Emailing worksheets in body
When I try to send a worksheet in the body of an email, i only gets options to mail recipient (for review) and mail recipient (as attachment), I no longer can just send an email with the worksheet in the body. How can I change this. I also just installed Adobe Professional 6.0 which has review features to it, I don't know if that affected my Excel or not. ...

Importing JEs through the Table Import
Is there a way to import JEs throught the table import. If so, how is this accomplished? Please help! Thank you! If you have access to table import you must also own integration manager. either way, yes, you can import transactions. please give me a call at 214-373-8550 and we can walk through the process. Leslie "Christina" wrote: > Is there a way to import JEs throught the table import. If so, how is this > accomplished? Please help! Thank you! You can use Table Import but Integration Manager is much, much easier to use. If you can use Table Import, you own Inte...

Importing Dynamic data
Hi I have some tables in various xl files, call the files a,b and c. I want to import all these into a single xl file called e. If changes are made to a,b or c I want it to automatically update e. I have used the import function in d but if I change a,b or c to see the change I have to select the data in d and press refresh. Furthermore when I refresh d i have to have files a,b and c open otherwise it says connection lossed and is unable to refresh the data. Can someone explain to me in simple terms what I have to do in order to get the data automatically updated without having to alway...

Importing a CSV file
Hi, When I try to import a CSV file into Outlook, it says I have to first install the DATA1.MSI file from my windows XP installation disk. I looked at my installation disk and here doesn't seem to be such a file. How can I import? Thanks, Randy If you have the correct installation disk, then all you need do is run the Office setup - Add/Remove options and add the Outlook import filters. Karl -- ____________________________________________________________ Karl Timmermans - The Claxton Group ContactGenie - QuickPort/DataPort/Exporter/Toolkit/Duplicate Contact M...

Exchange 5.5
Is there a way in Exchange 5.5 to accept mail addressed only to the local domain and drop everything else, with no NDR to the sender? I know how to block inbound mail from specific addresses and domains but not how to accept mail for local domain only. I'm running Exchange 5.5 on Win2k. Thanks. On Tue, 24 May 2005 11:37:08 -0700, "coop" <coop@discussions.microsoft.com> wrote: >Is there a way in Exchange 5.5 to accept mail addressed only to the local >domain and drop everything else, with no NDR to the sender? I know how to >block inbound mail from specif...

archiving emails #2
Hi, When I archive my emails, I find that attachments are also being archive with the emails. Is there a way which allows me to only archive the email and not its attachments? thanks In news:1134832411.359443.45580@g49g2000cwa.googlegroups.com, Lynn <moley_cruz@yahoo.com.au> typed: > Hi, > When I archive my emails, I find that attachments are also being > archive with the emails. > Is there a way which allows me to only archive the email and not its > attachments? > > thanks The attachments are part of the messages, so, no. What is it you wish to do, exactly? ...

Import DB from CRM 1.2 to 3.0
Hi to all, How can I import the DB or data from CRM 1.2 to new CRM 3.0? Now my CRM DB are on SQL2000 server. Thank and regards. Augusto You should really upgrade CRM1.2 to 3.0. The data structutres are different enough that doing a migration would be pretty painful. Any reason not to upgrade? "IGBA75" <a.crippa@ieti.biz> wrote in message news:%23c97ZdkXGHA.3660@TK2MSFTNGP04.phx.gbl... > Hi to all, > > How can I import the DB or data from CRM 1.2 to new CRM 3.0? > Now my CRM DB are on SQL2000 server. > > Thank and regards. > Augusto > ...

I Open email, hit Reply and it sends several emails with no message.
Hello, I open my email, hit Reply and before I can write anything it sends the email out with no message. Usually this happens twice and the third time it will wait until I write the message and click Send. I'm sure it's annoying to the person receiving this. Can you tell me how to fix this? Thanks!!! -- tms Posted via http://www.vistaheads.com Are you hitting Alt-S ? That will send the email. Dave N. MS-MVP (Mail) Windows 7 Ultimate 64 http://download.live.com/wlmail "tms" wrote in message news:tms.4e5n4e@no-mx.forums.vistaheads.com... ...

why are my important emails going into junk email
I posted on outlook general and didn't get a response. so I looked here and there was no clue as to what is happening. I am using outlook 2007 on the desktop. now any mail coming in from facebook is going to junk email. also my zdnet newsletter is going there also. I have added their domain to the safe list but they are still going to junk. this probably started the other day when I got outlook 2003 going on my laptop so I could see my emails when I am away from home. I did lower the category for junk mail one item but that didn't help either. don't know what...

Saving Emails #4
How do you save emails, if you know your computer is fixing to go kaput! Click on File, Export and create a .pst file copying all subdirectories. Save it to CD if possible and it can be imortered onto a new computer... BB >-----Original Message----- >How do you save emails, if you know your computer is >fixing to go kaput! >. > Better yet, if the original poster is already using a .PST file, he can copy the file to a safe location, then copy it to his new hard drive or computer and re-use it in Outlook there. No need to import and export, and in fact doing so can cause...

external email allow to relay by IP
in exchange 2003 i had rules on the smtp connector to allow relay for a few IPs (mainly to allow a few external users with static IPS, to use the server to send and receive email) where's this option in 2007 ? -mark On Fri, 2 Mar 2007 13:13:23 -0000, "luna" <luna_s@themoon.com> wrote: >in exchange 2003 i had rules on the smtp connector to allow relay for a few >IPs (mainly to allow a few external users with static IPS, to use the server >to send and receive email) > >where's this option in 2007 ? > >-mark > http://msexchangeteam.com/a...

how can i import worksheets from multiple workbooks
Hi, I have a bunch of workbooks that all used the same template and were filled out for each week of the year. They all have a "totals" sheet the collects all the important data within. What i want to do is create a macro that imports that totals page, or a section of it from a bunch of these different workbooks, say all the ones in january or maybe the entire years worth so i can do some more analysis. my VBA skills are terrible but i am learning slowly. Any help would be appreciated. Hi David You can start here http://www.rondebruin.nl/copy3.htm -- Regards Ron de Bruin h...

Moving Exchange Connector
Hi, We are decommissioning an old Exchange 2000 server and need to migrate the MS CRM connector to an Exchange 2003 server. Can somebody point me in the direction of some documentation for this? I can't seem to find anything in the MSKB. Thanks Uninstalling the connector on the old server and installing it on the new one should be all you need. You might want to check the registry on the CRM server though to see if all the entries for the old Exchange server were removed. This is under local system\software\microsfit\mscrm. "Warren Cundy" <wcundy@markanthony.com> ...

Outgoing emails keep getting stuck
I have Exchange Server 2003 as part of Small Business Server 2003 and am having problems with outgoing email (SMTP). When I reboot the server, everything runs fine for a day or two, but after a while, outgoing email hangs up and the emails start timing out and coming back undeliverable. I have looked up several of the stuck emails in the message tracking center, and the history shows several "Started Outbound Transfer of Message" and then "Message transferred to mail.destinationserver.com through SMTP". However, it never gets there, and I see these two lines repeate...