Hello Kashif,
I am working with the library Aspose.Email in Java and I have the problem that I‘ m not able to add a brithday/anniversary to MapiContact.
I have seen your following post: Working with Outlook Contacts|Documentation
I have used the class MapiContactEventPropertySet to create a brithday/anniversary. But I can’t see the created birthday in Outlook.
Can you please help me. Perhaps there is a date format problem.
My code is:
String date = “2005/10/14”;
java.util.Date birthday = null ;
try {
SimpleDateFormat formatter = new SimpleDateFormat(“yyyy/MM/dd”);
birthday = formatter.parse(date);
} catch (ParseException e) {
e.printStackTrace();
}
// set time to 00:00:00
long HOUR = 3600*1000;
Date anniversary = new Date(birthday.getTime() + 2 * HOUR);
MapiContactEventPropertySet event = new MapiContactEventPropertySet();
// Fri Oct 14 00:00:00 CEST 2005 → formatted time to 00:00:00
event.setWeddingAnniversary(anniversary);
event.setBirthday(birthday);
// add to MapiContact
contact.setEvents(event);
Thank you very much and best regards,
Mona Basit
This message was posted using Email2Forum by Kashif Iqbal.