Solved

How to Import and Export data from Outlook to Database...

Posted on 2004-03-22
4
1,294 Views
Last Modified: 2011-09-20
Hallo Experts,

I am having an application(that uses JSP + Postgresql database)..With My application, i can import data from EXCEL into my database fields and also, i can export data from database fields to EXCEL/CSV.

I want to make some enquiries of how it is possible to import data from “Outlook” into my application and how i can export informations from my application into “Outlook”.

I want to know how the export format of “Outlook” looks like (which fields and format --> e.g. are this plain text fields or dropdown boxes …)

How it is possible to combine the content of the “Outlook”-fields with the my applications database fields.

Eagerly waiting for your EARLIER suggestions.

Best Regards,
Jagdeesh.
0
Comment
Question by:jaggybala
  • 2
4 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 10647762
you can automate outlook as a COM object but i don't know how to do that in Java

there is an intro to javamail here
http://www.javaworld.com/javaworld/jw-10-2001/jw-1026-javamail.html

hope this helps a bit
0
 

Author Comment

by:jaggybala
ID: 10647782
hi,

 i already use this E-Mail progra for my application, but i dont know how the export format of 'Outlook' looks like and how i can import an EXCEL data from 'Outlook' to my database fields(Postgresql).

- Jagdeesh.
0
 
LVL 44

Accepted Solution

by:
bruintje earned 400 total points
ID: 10647812
if you can use an odbc entry for your postgres db then you could directly add fields to the db with some vbs script like in

source : http://archives.postgresql.org/pgsql-interfaces/1999-08/msg00285.php
snippet:
-----------
Const adOpenStatic = 3
Const adLockOptimistic = 3
Const adCmdText = 1
'DSN USING POSTGRES/ODBC DRIVER FOR WIN32.
Const DSN = "PostgresContacts"
Call Main()
WScript.Quit (0)
Sub Main
      'SET OUTLOOK OBJECTS TO REFER TO ITEMS IN PUBLIC FOLDER
      Set objOutlook = Wscript.CreateObject ("Outlook.Application")
      Set objNameSpace = objOutlook.GetNameSpace("MAPI")
      Set objPublicFolders = objNameSpace.Folders("Public Folders")
      Set objAllPublicFolders = objPublicFolders.Folders("All Public Folders")
      Set ContactItems = objAllPublicFolders..Folders("Some Contacts")
      varSQL =  "Select * From PMStoreContacts"
      varSQL_Del  =  "Delete  From PMStoreContacts "
      'CREATE ADO RECORDSET OBJECT
      Set rsChains = WScript.CreateObject("ADODB.Recordset")
      rsChains.open varSQL_Del, DSN, adOpenStatic, adLockOptimistic
      rsChains.open varSQL, DSN, adOpenStatic, adLockOptimistic
      For Each Item in ContactsItems      
            rsChains.addnew
            rsChains("Project Manager") = Item.SomeField
            ...
            rsChains.Update
            rsChains.movenext
      next
      rsChains.Close
      '****SETTING OBJECTS FOR GETTING OUTLOOK INFORMATION TO NOTHING TO RELEASE THEM FROM MEMORY (sort of...)****
      Set objOutlook = nothing
      Set objNameSpace = nothing
      Set objPublicFolders = nothing
      Set objAllPublicFolders = nothing
      Set ContactsItems = nothing
      '****SET RECORDSET OBJECT TO NOTHING********
      Set rsChains = Nothing
End Sub
-----------

this is a vbs script using the windows scripting host, not sure if you can adapt the idea / ODBC connection to your environment
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now