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

Export e-mail strings to database



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 22nd 06, 03:33 PM posted to microsoft.public.outlook.program_vba
nemesis345crew@gmail.com
external usenet poster
 
Posts: 3
Default Export e-mail strings to database

Well I wabt to ask all of you AND IF

ANYONE KNOWS TO LET ME KNOW:

Is there any way to insert mail strings to a database without doing
copy paste each one a time?

The strings are a request from a form!
Unfortunately those mail was received before we made a method so they
are inserted at once in the data base.

  #2  
Old May 22nd 06, 05:13 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Export e-mail strings to database

This is a very general question! The Outlook Object Model and ADO libraries
provides all the plumbing you need to read from Outlook and write to a
database. Can you be more specific please?

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


" wrote:

Well I wabt to ask all of you AND IF

ANYONE KNOWS TO LET ME KNOW:

Is there any way to insert mail strings to a database without doing
copy paste each one a time?

The strings are a request from a form!
Unfortunately those mail was received before we made a method so they
are inserted at once in the data base.


  #3  
Old May 23rd 06, 10:12 AM posted to microsoft.public.outlook.program_vba
nemesis345crew@gmail.com
external usenet poster
 
Posts: 3
Default Export e-mail strings to database

I have a huge number of emails, which including text is sth like that:

name: tonia
occupation: unemployed
married: no
education: college

(this is just a sample which is similar to mine so you can understand
who thing goes)

Now all these mails i want to insert them into an MS Access database in
table with that kind of construction:

column1 -- name
column2 -- occupation
column3 -- married
column4 -- education

All i'm asking is if that huge number of mails, can be inserted into
the base, because the manually way it will take "years".

Well now I hope you could understand what kind of problem do i have!

  #4  
Old May 23rd 06, 09:40 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Export e-mail strings to database

There is very much possible. Below is an example of reading all e-mails in
the current folder and creating a new record in an Access database using DAO.
You can easily modify it to parse the message body to get the field/value
combinations you want, or switch to using ADO instead:

Sub WriteEmailToDatabase()
Dim objFolder As Outlook.MAPIFolder, objItems As Outlook.Items
Dim objEmail As Outlook.MailItem, objMessageObj As Object
Dim dbsThis As DAO.Database, rstThis As DAO.Recordset

Set dbsThis = DAO.OpenDatabase("C:\Documents and
Settings\elegault\Desktop\db1.mdb")
Set rstThis = dbsThis.OpenRecordset("Table1", dbOpenDynaset)

Set objFolder = Application.ActiveExplorer.CurrentFolder
Set objItems = objFolder.Items
For Each objMessageObj In objItems
If objMessageObj.Class = olMail Then
Set objEmail = objMessageObj

'SAVE TO ACCESS DATABASE
rstThis.AddNew
rstThis("Subject") = objEmail.Subject
rstThis("Body") = objEmail.Body
rstThis.UPdate
End If
Next
End Sub

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


" wrote:

I have a huge number of emails, which including text is sth like that:

name: tonia
occupation: unemployed
married: no
education: college

(this is just a sample which is similar to mine so you can understand
who thing goes)

Now all these mails i want to insert them into an MS Access database in
table with that kind of construction:

column1 -- name
column2 -- occupation
column3 -- married
column4 -- education

All i'm asking is if that huge number of mails, can be inserted into
the base, because the manually way it will take "years".

Well now I hope you could understand what kind of problem do i have!


 




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
Export e-mail strings to database nemesis345crew@gmail.com Outlook and VBA 0 May 22nd 06 03:32 PM
Automate export of Appointment Insert/Update/Delete infomation to the database cookiesncreamychoc@hotmail.com Add-ins for Outlook 2 March 14th 06 03:59 AM
export mail account settings Jack Outlook Express 6 January 13th 06 02:15 AM
Export / save mail rule Wayne S Outlook Express 2 January 10th 06 07:41 AM


All times are GMT +1. The time now is 04:47 AM.


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.