We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose 6.x MapiMessage class does not show methods in javadocs?

I get the following error for all of the properties-based getters I’ve tried:

java.lang.NoSuchMethodException: com.aspose.email.MapiMessage.getCategories()
at java.lang.Class.getDeclaredMethod(Class.java:2009)

Where are these methods identified by the online javadocs for MapiMessage???

I have seen similar issues with other classes. For example, I can’t find MapiAttachmentCollection.get(#)
I only find .get_Item(#)

Can you please clarify what the correct methods are?

I’m using Java 7.

Thanks,
AJ

Sorry, the first part of this is programmer error. The superclass has the method, so my reflection didn’t find it via getDeclaredMethod.


The get vs get_Item() thing is still weird in my opinion.

Thanks,
AJ

Hi Aaron,

Thank you for writing to Aspose Support team.

Please use the get_Item(index) method to get the attachment at respective index. The get method is obsolete and is no more available in the latest version of the API. Please let us know if we can be of any additional help to you in this regard.

Sample Code:

MapiMessage mapi = MapiMessage.fromFile(“sample.msg”);

ByteArrayOutputStream byteArrayOutputStream= new ByteArrayOutputStream();

mapi.getAttachments().get_Item(0).save(byteArrayOutputStream);