ITask::GetRecurrencePattern
The GetRecurrencePattern method gets the IRecurrencePattern object that represents the recurrence attributes of a task. If there are no existing recurrence attributes, an empty IRecurrencePattern object is returned.
Syntax
HRESULT GetRecurrence(
IRecurrencePattern* pRec
);
Parameters
- pRec
[out] Reference to the recurrence pattern.
Return Values
This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:
- S_OK
The method completed successfully.
Example
The following code sets the recurrence pattern attributes for a new task.
void CreateRecurringTask(IApplication * pApp)
{
ITask * pTask;
IRecurrencePattern * pRec;
SYSTEMTIME st;
DATE date;
// Create task.
polApp->CreateItem(olTaskItem, (IDispatch**)&pTask);
pTask->put_Subject(TEXT("Recurring Task"));
// Convert Monday, 4/5/99 to a DATE.
memset(&st, 0, sizeof(SYSTEMTIME));
st.wMonth = 4;
st.wDay = 5;
st.wYear = 1999;
polApp->SystemTimetoVariantTime(&st, &date);
// Set the start and due date, and save the task.
polTask->put_StartDate(date);
polTask->put_DueDate(date);
polTask->put_Importance(olImportanceHigh);
// Set the recurrence pattern.
pTask->GetRecurrencePattern(&pRec);
pRec->put_RecurrenceType(olRecursWeekly);
pRec->put_DayOfWeekMask(olTuesday);
pRec->put_NoEndDate(TRUE);
polTask->Save();
// Release objects.
pTask->Release();
pRec->Release();
}
Requirements
Smartphone: Windows Mobile 2002 and later
OS Versions: Windows CE 3.0 and later
Header: pimstore.h
Library: pimstore.lib
See Also
How to: Create a Recurring Appointment
Pocket Outlook Object Model API Interfaces
Pocket Outlook Object Model API Enumerations
Last updated on Friday, April 22, 2005
© 2005 Microsoft Corporation. All rights reserved.
Send feedback on this topic to the authors.