1

We have an application that has two parts, and want both to be able to access the same fields of Outlook items. By field, I mean any type of key-value type of data which can be stored on the items, because apparently it seems there are multiple kind of them. So the two parts of the application are:

  • a Java application using the official EWS library provided by MS
  • an Outlook form using VBScript

We are able to access Outlook items from the Java app, and even store and retrieve so called extended properties. But only those ones which were stored via the same API. As far as I know, the code for this would be very similar in C# too.

ExtendedPropertyCollection epc = appointment.getExtendedProperties();
for (ExtendedProperty ep : epc) {
    // these do not print anything, epc.getCount() returns 0
    System.out.println(" extendedpropC: " + ep.getClass());
    System.out.println(" extendedpropV: " + ep.getValue());
}

In the Outlook form, we are able to store values of textboxes into fields by mapping the textboxes to the fields the way it is described here. So after saving and reopening the item, the custom textboxes are populated with the values from the fields. But when trying to access these values via EWS, they are simply not there, and vice versa.

So are there multiple 'slots' for these extended properties for the multiple APIs/languages?

Or, to broaden the question, what methods/APIs would you use key-value type data into Outlook items, which should be somehow accessible from Java?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
Alex Biro
  • 1,069
  • 1
  • 14
  • 27

1 Answers1

1

You can access any MAPI property using AppointmentItem.PropertyAccessor.GetProperty.

You can see the properties and their DASL names (that you will need to use when calling GetProperty) in OutlookSpy (I am its author): select the appointment, click IMessage button, select the property in question, look at the DASL edit box.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Thank you, I am getting closer, but not there yet. With OutlookSpy I was able to find the ExtendedProperty I added via EWS, I have it's DASL. How do I read this property in VBScript in a from? I can also see the field mapped from the form, its value is properly stored, but how do you access that? When listing the item's ExtendedProperties, it does not have any. Thank you. – Alex Biro Oct 10 '13 at 11:12
  • VB script can use AppointmentItem.PropertyAccessor.GetProperty. I don't know about EWS, sorry. – Dmitry Streblechenko Oct 10 '13 at 16:34