Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JMSG
>
Tutorial
> Create appointment
The following example shows you how to create an appointment.
import java.io.IOException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import com.independentsoft.msg.Message; public class Example { public static void main(String[] args) { try { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); Date date1 = dateFormat.parse("2024-01-25 10:00:00"); Date date2 = dateFormat.parse("2024-01-25 11:00:00"); Message appointment = new Message(); appointment.setMessageClass("IPM.Appointment"); appointment.setSubject("Test"); appointment.setBody("Body text"); appointment.setLocation("My Office"); appointment.setAppointmentStartTime(date1); appointment.setAppointmentEndTime(date2); appointment.save("c:\\temp\\appointment.msg", true); } catch (IOException e) { e.printStackTrace(); } catch (ParseException e) { e.printStackTrace(); } } }
Need help? Ask our developers:
Name*
Email*
Message*