Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1304
  • Last Modified:

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

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
jaggybala
Asked:
jaggybala
  • 2
1 Solution
 
bruintjeCommented:
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
 
jaggybalaAuthor Commented:
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
 
bruintjeCommented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now