Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / October 2005

Tip: Looking for answers? Try searching our database.

Java Libray to extract email Contact Only from Outlook file

Thread view: 
pcouas - 28 Oct 2005 08:45 GMT
Hi,

Does anyone know of a Java library that can extract email contact ONLY
from Outlook .pst files.
I just need to get email list from pst file in real time for my Java
Applet.

Regards
Philippe
Roedy Green - 28 Oct 2005 10:40 GMT
>Does anyone know of a Java library that can extract email contact ONLY
>from Outlook .pst files.
>I just need to get email list from pst file in real time for my Java
>Applet.

If you can't find what you want, perhaps Outlook has some export
format that is more tractable.

The format looks to be unusually opaque to figuring it out by
experiment.
Signature

Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.

John - 28 Oct 2005 10:55 GMT
> The format looks to be unusually opaque to figuring it out by
> experiment.

You can post that again! PST is a nightmare format. All of the tools
that I've seen for converting it only work in a patchy way.

The best way to do it AFAIK is to upload the files to an IMAP server
using outlook and then download them using a proper email client.

For the OP's problem, perhaps he could either convert the files ahead of
time in this way, or somehow incorporate a live IMAP server and just
access the mail from there.

John
Rogan Dawes - 28 Oct 2005 11:15 GMT
>>Does anyone know of a Java library that can extract email contact ONLY
>
[quoted text clipped - 8 lines]
> The format looks to be unusually opaque to figuring it out by
> experiment.

Note that you'd have to use a signed applet to get access to the PST in
the first place. Disregarding entirely the fact that the address book is
typically not stored in the PST in the first place, but rather a .PAB file.

It sounds to me like you want your applet to be able to send email on
the user's behalf. But if the user is using outlook, you may have to
send email via MAPI (not IMAP), which, as far as I know, has ZERO
support in Java.

I'd suggest looking at this in a different way, if at all possible.

Perhaps you can simply present a mailto: link, and let the user just
click on it to send an email? Outlook can automatically resolve email
links like

mailto:bloggs, joe

using the address book, so that might work for you.

Rogan
pcouas - 28 Oct 2005 15:01 GMT
"Mail to", could not transfert attachement ?
I want, reading adress from outlook and sending mail from my Signed
Applet ?

Philippe
Dave - 29 Oct 2005 15:47 GMT
Not sure about your budget, but I found this is good for dealing with
outlook appointments, contacts, etc...

http://www.kova-solutions.com/joc/

> "Mail to", could not transfert attachement ?
> I want, reading adress from outlook and sending mail from my Signed
> Applet ?
>
> Philippe
pcouas - 31 Oct 2005 11:12 GMT
I have found a solution with OpenSource Project Jacob

package Activex01;

import com.jacob.activeX.*;
import com.jacob.com.*;

public class getContacts {
public static void main(String[] args) {
final int olFolderContacts = 10;

ActiveXComponent ol = new ActiveXComponent("Outlook.Application");
Dispatch dsp = new Dispatch();

Dispatch olo = ol.getObject();
Dispatch myNamespace = Dispatch.call(olo, "GetNamespace",
"MAPI").toDispatch();
Dispatch myFolder = Dispatch.call(myNamespace, "GetDefaultFolder",new
Integer(olFolderContacts)).toDispatch();

//nächste zeile Fehlermeldung

Dispatch items = Dispatch.get(myFolder, "Items").toDispatch();

int count = Dispatch.call(items, "Count").toInt();

for (int i = 1; i <= count; i++) {
Dispatch item;
item = Dispatch.call(items, "Item", new Integer(i)).toDispatch();

String fullName = Dispatch.get(item, "Fullname").toString();
String emailAddress = Dispatch.get(item, "Email1Address").toString();
String addressStreet = Dispatch.get(item, "BusinessAddressStreet")
.toString();
String addressCity = Dispatch.get(item, "BusinessAddressCity")
.toString();
String addressCountry = Dispatch.get(item, "BusinessAddressCountry")
.toString();
String addressPostalCode = Dispatch.get(item,
"BusinessAddressPostalCode").toString();
String addressState = Dispatch.get(item, "BusinessAddressState")
.toString();
String title = Dispatch.get(item, "Title").toString();
String phone = Dispatch.get(item, "BusinessTelephoneNumber")
.toString();
String fax = Dispatch.get(item, "BusinessFaxNumber").toString();

printField("", fullName);
printField("", title);
printField("", addressStreet);
printField("", addressCity);
printField("", addressState);
printField("", addressPostalCode);
printField("", addressCountry);
printField("Tel:", phone);
printField("Fax:", fax);
printField("Email:", emailAddress);

System.out.println();
}
}

public static void printField(String label, String value) {
if (value.length() != 0) {
System.out.println(label + " " + value);
}
}
}


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.