Accepting appointments

Hi

In regards to this old thread Free Support Forum - aspose.com, can you please advise how we can programmatically mark an imported appointment as accepted, using the ICS and code as previously shown.

The main reason for this is that appointments imported to Exchange show as ‘tentative’ using Mobile devices, unless manually marked as Accepted.

calDoc.setStatus(AppointmentStatus.Confirmed);

seems to have no effect.

Thanks

Hi Peter,

Are you trying to add an accepted appointment of one use to an account of another user on Exchange? We have tried to do so through MS Outlook and its behavior is the same i.e. the appointment turns to non-accepted mode. Please elaborate your scenario for our understanding. You can share steps and sample code to reproduce the problem for further analysis at our end. We’ll look into it for assisting you further.

Hi Kashif

What I’m trying to do is take a basic ICS file, e.g.

BEGIN:VCALENDAR
VERSION:2.0
METHOD:REQUEST
PRODID:-//Test Company//NONSGML My Product//EN
BEGIN:VEVENT
CLASS:PUBLIC
TRANSP:OPAQUE
DTSTART:20170322T220000Z
DTEND:20170322T230000Z
DTSTAMP:20170322T004138Z
CREATED:20170314T005215Z
LAST-MODIFIED:20170322T013130Z
UID:87ADB15FB0731E4DCC257D1E0003D023
SEQUENCE:0
ORGANIZER;CN=“John Lowndes”:mailto:John_Lowndes@xxyyzz.com
ATTENDEE;CN=“Joe User”;RSVP=FALSE:mailto:joe.user@xxyyzz.com
SUMMARY:Test Meeting
DESCRIPTION:This is the description
END:VEVENT
END:VCALENDAR

and import that to a PST using Aspose Email for Java 17.6, AND marking the appointment as Accepted in the PST.

I’ve tried using PARTSTAT=ACCEPTED, plus Aspose functions as above, but I can’t find any way to import the appointment AND mark it as Accepted in the PST. Can you please advise if there is some message flag or function that will achieve this?

Initial code used;

String pathPSTFileStr = "c:\\temp\\testPST.pst";           
String testFile = "c:\\temp\\test.ics";

PersonalStorage pst = PersonalStorage.create(pathPSTFileStr, 0);
Appointment calDoc = Appointment.load(testFile);
MailMessage calMsg = new MailMessage();
calMsg.addAlternateView(calDoc.requestApointment());
MapiMessage calMapiMsg = MapiMessage.fromMailMessage(calMsg);
FolderInfo calFolder = pst.createPredefinedFolder("Calendar", StandardIpmFolder.Appointments);
MapiCalendar mapiCal = (MapiCalendar)calMapiMsg.toMapiMessageItem();    
calFolder.addMapiMessageItem(mapiCal);

Thanks

@ionet,

We have tried this at our end and observed the same. The appointment couldn’t be added in accepted state. But at the same time, we couldn’t find any method of adding this to a PST file using MS Outlook directly for the expected behvaior. Whenever such a file is added to PST, the options of accepting, rejecting or tentative again appear. Even if we save an accepted appointment from MS Outlook to disc as ICS, it doesn’t contain this PARTSTAT=ACCEPTED which shows that MS Outlook keeps information about accepted appointments. The behavior of API seems to be similar to that of MS Outlook in this case.

OK thanks Kashif

So there is no way to do this, that you are aware of? For example, is it possible to call VBA macros with Aspose?

Regards

@ionet,

Could you please try setting the Appointment.Method to Reply and see if it serves your needs?

Appointment calDoc = Appointment.Load(testFile);
calDoc.Status = AppointmentStatus.Confirmed;
calDoc.Method = AppointmentMethodType.Reply;

Hi Kashif

Unfortunately not, it just shows “We couldn’t find this meeting in the calendar. It may have been moved or deleted.”

Is there any way using Aspose to either set an imported meeting as accepted, or run a VBA macro?

Thanks

@ionet,

Outlook keeps a reference to the accepted appointment and this is somehow independent of 3rd party APIs. We couldn’t achieve the same using MS Outlook where such a meeting could be added without Outlook complaining about the entry missing in the calendar. Aspose.Email API doesn’t provide support for VBA macros. Please let us know if we can be of any additional help to you in this regard.

OK thanks Kashif.

One last question, is there a way to use Aspose to also send an imported meeting, i.e. the ICS file above, to the attendees? So in this case Aspose Email for Java would import the Appointment into the calendar of John Lowndes, and at the same time send an invite to Joe User, who could then accept/decline etc using normal Outlook functionality.

Thanks

@ionet,

You can use the API’s SmtpClient to send a loaded Appointment. Please have a look at the code sample mentioned in sending meeting requests via SmtpClient of the API for this purpose and let us know if you need any further assistance in this regard.

Thanks,
Kashif

Hi Aspose

Thanks for the pointer, we can send invites using the SMTP Client. But the sent meeting, when added to the Chairs calendar, still contains a status of ‘You haven’t sent this meeting invitation yet’, with a ‘Send’ button, instead of a ‘Send Update’ button (e.g. indicating that an invitation has been sent). How can we save sent invitations in the Chairs Calendar, so that the meeting shows it has been sent, and therefore shows Attendee Tracking etc?

For example, if I drag/drop the ICS file below into my Outlook calendar (I am listed as the Chair, you will need to do the same), it displays as per the attached screenshot. If I use Aspose, I do not see that the invite has been sent - how can I show that?

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//IONET Software//NONSGML Notes Release 9.0.1FP6//EN
BEGIN:VEVENT
CLASS:PUBLIC
TRANSP:OPAQUE
DTSTART:20170713T160000
DTEND:20170713T163000
DTSTAMP:20170706T213214Z
LAST-MODIFIED:20170706T213449Z
SEQUENCE:0
ORGANIZER;CN=Peter [Smith:mailto:peter@ionetsoftware.onmicrosoft.com]
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;CN=“Lowndes, John”
:mailto:jlowndes@ionet.co.nz
UID:E0A3F2CC52AD63EF85258155007623F6
SUMMARY:Meeting Test
DESCRIPTION:30 minute meeting
LOCATION:
END:VEVENT
END:VCALENDAR

sample_meeting_sent.gif (40.6 KB)

Also how can we see historical posts, like the one I referenced at the top of this thread?

Thanks

@ionet,

Could you please share with us if this is required in reference to Exchange server? If so, you need to use the EWSClient of the API for creating such an appointment using the CreateAppointment method as shown in the following code sample.

Sample Code

Appointment app = new Appointment("meeting request", DateTime.Now.AddDays(1), DateTime.Now.AddDays(2),  "organizer@domain.com", "attendee@gmail.com");

app.Summary = "meeting request summary";
app.Description = "description";
app.Description = "NETWORKNET-34136 Exchange 2007/EWS: Provide support for Add/Update/Delete calendar items";

IEWSClient client = GetAsposeEWSClientTest3Account();  //organizer's exchange account
string uid = client.CreateAppointment(app);

Hi Kashif

The EWSClient is not available in this case.

All we really want to do is recreate the result of a manual drag/drop (or import) of the above ICS file into the Chairs calendar, such that it displays as per Outlook (e.g. in the screenshot). Please note the meeting only displays like this (showing the ‘Send Update’ button) when manually adding to the Chairs calendar, not to an attendee calendar.

Is there any way that is possible?

Thanks

@ionet,

If we create an empty PST and drag drop your attached ICS file to it, it doesn’t show the “Send Update” buton as shown in your previous image. The same is behavior exhibited by Aspose.Email API. We believe this is based on some relation between the account in MS Outlook and the Organizer of the Appointment that is maintained by MS Outlook itself. In light of these findings, we couldn’t find any such settings using the API that could be used to achieve your requirements. We are further going to discuss this with our Product team to see if there could be any such possibility and will update you here once there is some feedback available in this regard.

Hi Kashif

Yes, to test properly you need to make the Organizer address in the ICS file match the Outlook Account address, to indicate it is the Chairs calendar. If you do that, drag/drop of the ICS file displays ‘Send Update’ in the calendar, indicating that invitations have already been sent. That is what we want to achieve using your API, which currently displays ‘You haven’t sent this meeting invitation yet’ and a ‘Send’ button.

Thanks

@ionet,

Yes, we have tried the same by changing the organizer to one that is configured in MS Outlook and only then it shows the information that is desired by you. However, if we add the same to an empty PST in MS Outlook, the status is not found and it says “You haven’t sent this meeting invitation yet”. Even if we drag/drop the same using MS Outlook, the behavior is the same which shows that Outlook keeps some information link between the configured account and organizer of appointment for this purpose, which is not possible using Aspose.Email API.

Hi Kashif

OK thanks. So there is no way for Aspose.Email to determine if the Outlook account information matches the ORGANIZER address in the ICS file - indicating the Appointment is being added to the Chairs calendar - and change the Appointment display/details appropriately?

@ionet,

I am afraid it is like this for now. However, we have forwarded your requirements to our Product team to have an insight about any such possibility. We’ll update you here once there is some feedback available in this regard. We appreciate your patience until then.

OK thanks Kashif

@ionet,

Our product team has looked into it in further detail and the findings are no different than the one we shared with you earlier here. Thus, it is not possible to achieve your desired results with the API. Please let us know if you have any further query in this regard.