I am creating an appointment in Outlook through java code. here I can set new values to the fields in appointment. The code for it is
OleAutomation appointment = invoke(outlook, "CreateItem", 1).getAutomation();
appointment.setProperty(property(appointment, "Subject"), new Variant("Test"));
this code will set the subject field with the value “Test”.
here i am using generic OLE mechanism “Variant” for passing data of different types via a common interface
Now I want to know how to set a date for the appointment. Please help me..
Thanks in advance 🙂
As stated in my comment, the date in OLE are stored as the number of days since 1899-12-30.
You can calculate that number easily. When you have it, pass-it to to the right OLE property using standard variant I think.
Unfortunately I don’t have SWT installed here and can’t test the code, but it should look something like that
More info on the automation of Outlook can be found here for a complete example in VB