-
Notifications
You must be signed in to change notification settings - Fork 5
Create, Save and Read Outlook Contacts
shoaibkhan-aspose edited this page Jan 5, 2015
·
1 revision
MapiContact contact = new MapiContact("Sebastian Wright", "[email protected]");
contact.setNameInfo(new MapiContactNamePropertySet("Bertha", "A.", "Buell"));
contact.setProfessionalInfo(new MapiContactProfessionalPropertySet("Awthentikz", "Social work assistant"));
contact.getPersonalInfo().setPersonalHomePage("B2BTies.com");
contact.getPhysicalAddresses().getWorkAddress().setAddress("Im Astenfeld 59 8580 EDELSCHROTT");
contact.getElectronicAddresses().setEmail1(new MapiContactElectronicAddress("Experwas", "SMTP", "[email protected]"));
contact.setTelephones(new MapiContactTelephonePropertySet("06605045265"));
// Set Photo Data
File fi = new File(dataPath + "Aspose.jpg");
byte[] fileContent = Files.readAllBytes(fi.toPath());
MapiContactPhoto photo = new MapiContactPhoto(fileContent, MapiContactPhotoImageFormat.Jpeg);
contact.setPhoto(photo);
// Save as MSG
contact.save(dataPath + "contact.msg", ContactSaveFormat.Msg);
// Loading MSG
MapiMessage msg = MapiMessage.fromFile(dataPath + "contact.msg");
MapiContact mapiContact = (MapiContact)msg.toMapiMessageItem();
Download Source Code
For further releases and updates, please follow these new repositories:
- Aspose.Words Java for Apache POI
- Aspose.Cells Java for Apache POI
- Aspose.Slides Java for Apache POI
- Aspose.Email Java for Apache POI
- For documentation, please visit Aspose Docs.
- Raise your queries and suggest more examples via Aspose Forums or via new social coding sites.