Working with Appointments
Load and Save an Appointment in ICS Format
The Appointment class in Aspose.Email for Java can be used to load an appointment in ICS format as well as to create a new appointment and save it to a disk in ICS format. In this article, we first create an appointment and save it to a disk in ICS format and then we load it.
Create an Appointment and Save to Disk in ICS Format
The following steps are required to create an appointment and save it in ICS format.
- Create an instance of the Appointment class and initialize it with this constructor.
- Pass the following arguments in the above constructor
- End Date
- Start Date
- Created Date
- Last Modified Date
- Call the Save() method and specify the file name and format in the arguments.
The appointment can be opened in Microsoft Outlook or any program that can load an ICS file. If the file is opened in Microsoft Outlook it automatically adds the appointment in the Outlook calendar.
The following code snippets show how to create and save an appointment to a disk in ICS format.
Load Appointment ICS Format
To load an appointment in ICS format, the following steps are required:
- Create an instance of the Appointment class.
- Call the Load() method by providing the path of the ICS file.
- Read any property to get any information from the appointment (ICS file).
The following code snippets show how to load an appointment in ICS format.
Create a Draft Appointment Request
Draft Appointment Creation from Text
Adding and Removing Attachments from Calendar Items
Aspose.Email provides an attachments collection that can be used to add and retrieve attachments associated with calendar items. This article shows how to:
- Create and add attachments to an Appointment class object.
- Retrieve attachments information from an appointment.
- Extract attachments from an appointment.
The programming samples below demonstrate how to use the AppointmentFormattingOptions class to format text and HTML.
Programming Sample - Text Formatting
Programming Sample - HTML Formatting
Read Multiple Events from ICS File
Write Multiple Events from ICS File
Set Participants Status of Appointment Attendees
Aspose.Email for .NET API lets you set status of appointment attendees while formulating a reply message. This adds the PARTSTAT property to the ICS file.
Customize Product Identifier for ICalendar
Aspose.Email for Java API allows to get or set the product identifier that created iCalendar object.
How to get around Address Validation when trying to Load Appointments
AppointmentLoadOptions lo = new AppointmentLoadOptions(); lo.setIgnoreSmtpAddressCheck(true); Appointment appointment = Appointment.load("app.ics", lo);