Solved

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

Posted on 2004-03-22
4
1,299 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

623 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