Solved

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

Posted on 2004-03-22
4
1,290 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

Email signatures have numerous marketing benefits. Here are 8 top reasons to turn your email signature into a marketing channel.
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

772 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