ITask::GetRecurrencePattern
This method is not supported in Windows CE Platform Builder 3.0.
Returns the IRecurrencePattern object that represents the recurrence attributes of a task. If there are no existing recurrence attributes an empty IRecurrencePattern object is returned.
HRESULT GetRecurrence( IRecurrencePattern * pRec );
Parameters
- pRec
[out] Pointer to the recurrence pattern.
Return Values
S_OK indicates success. If an error occurs, the appropriate HRESULT value is returned.
Code Example [Visual Basic]
The following Visual Basic® code snippet sets the recurrence pattern attributes for a new task:
Sub CreateRecurringTask(polApp As PocketOutlook.Application)
Dim polTask As PocketOutlook.TaskItem
Dim polRec As PocketOutlook.RecurrencePattern
Set polTask = polApp.CreateItem(olTaskItem)
pTask.Subject = "Recurring Task"
pTask.StartDate = #4/5/1999#"
pTask.DueDate = #4/5/1999#"
Set polRec = polTask.GetRecurrencePattern()
polRec.RecurrenceType = olRecursWeekly
polRec.DayOfWeekMask = olTuesday
polRec.NoEndDate = True
polTask.Save
End Sub
Code Example [C++]
The following C++ 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
Runs On | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 2.0 and later | pimstore.h |
See Also
ITask::Unknown, ITask Property Methods
Last updated on Tuesday, July 13, 2004
© 1992-2000 Microsoft Corporation. All rights reserved.