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

Free Support Forum - aspose.com

Error working with MapiTak.setRecurrence with MapiCalendarYearlyAndMonthlyRecurrencePattern

I’m attempting to create a MapiTask with a recurrence patter based on MapiCalendarYearlyAndMonthlyRecurrencePattern.

When I add it to the PST, the following error is thrown:
AsposeException: BYSETPOS must only be used in conjunction with another BYxxx rule part.
at com.aspose.email.RecurrenceRule.a(SourceFile:418)
at com.aspose.email.CalendarRecurrence.a(SourceFile:585)
at com.aspose.email.CalendarRecurrence.b(SourceFile:352)
at com.aspose.email.CalendarRecurrence.a(SourceFile:274)
at com.aspose.email.MapiCalendarRecurrencePatternFactory.a(SourceFile:468)
at com.aspose.email.MapiTask.a(SourceFile:980)
at com.aspose.email.FolderInfo.addMapiMessageItem(SourceFile:817)

  1. Do you have any example code on how to create a MapiTask with a recurrence pattern?
  2. Can you fix the search feature on your forum? All the search terms that I enter return 0 results even with with terms that I have just found in the forum.


Welcome to our community! We need more information for investigating the issue:

  • A code example that throws the exception
  • The PST file
  • The version of Aspose.Email you are using

Please look at the article: Working with Calendar Items in PST File

Hi Andrey,
Thanks for your prompt response. The PST that was created did not have the Task in it, so that would not be useful for you.

Can you tell me what the exception means?

BYSETPOS must only be used in conjunction with another BYxxx rule part.

That would help me diagnose the problem.


It will take me a while to answer your question. Thank you for your patience.

To understand the problem, we need at least a code example demonstrating the creation of the MapiTask and recurrence pattern.