README List To Do Tasks #
What this does #
Retrieves tasks from the signed-in user’s default To Do Tasks list — the same list visible in Microsoft To Do and the Tasks pane in Outlook — via GET /me/todo/lists/Tasks/tasks. Authentication uses OAuth 2.0 with delegated permissions via VBAuth, supporting MFA. All tasks are fetched and filtered client-side by importance, due date, and completion status. Results display title, status, importance, and due date for each matching task.
Office apps #
- Access (tested M365)
- Excel (untested M365)
Required components #
- VBAuth.dll v1.x
- modVBAuthGlobalConstants.bas (from /shared)
- JSONConverter.bas (Tim Hall VBA-JSON)
- modListToDoTasks.bas (this module)
Azure Entra App Registration #
Delegated permissions:
- Tasks.Read
Note: application permissions are not supported for this endpoint. Admin consent is required for Tasks.Read in most organisational tenants.
VBAuth Admin Table – Required Values #
| Column Name | Required Value / Example | Notes |
|---|---|---|
| AppID | 13 | Identifies this feature’s configuration record |
| ActionName | VBAuth – List To Do Tasks | Display name — any value acceptable |
| ClientID | (your App Client ID) | GUID from Azure App Registration Overview blade |
| TenantID | (your Tenant ID) | GUID from Azure App Registration Overview blade |
| ObjectID | (your Object ID) | Set by PopulateMissingObjectIDs |
| ScopeClaims | Tasks.Read | Comma-separated Graph scopes |
| Verb | GET | HTTP method |
| URLPart1 | https://graph.microsoft.com/v1.0/me/todo/lists/Tasks/tasks | Graph endpoint |
| URLParameter1 | NO VALUE REQUIRED | Not used |
| URLPart2 | NO VALUE REQUIRED | Not used |
| URLParameter2 | NO VALUE REQUIRED | Not used |
| URLPart3 | NO VALUE REQUIRED | Not used |
| WaitForLogin | 60 | Seconds — NB MSXML2 timeout parameters are in milliseconds |
Module: modListToDoTasks.bas #
Public functions #
Public Function ListToDoTasks( _
strImportanceFilter As String, _
dtDueOnOrBefore As Date, _
blnHasDueFilter As Boolean, _
blnShowCompleted As Boolean, _
ByRef strMessage As String) As Boolean
Code language: JavaScript (javascript)
Sets intAppID = 13, loads configuration from lclVBAuthAdmin, acquires a bearer token for Tasks.Read, GETs all tasks from /me/todo/lists/Tasks/tasks, and applies client-side filtering. Returns True with a formatted task list in strMessage on HTTP 200. Returns False with a descriptive error on any failure.
Pass strImportanceFilter = "" to skip the importance filter. Pass blnHasDueFilter = False to skip the due date filter (the value of dtDueOnOrBefore is ignored in that case). Pass blnShowCompleted = True to include completed tasks.
Private functions #
FormatDueDateDisplay — extracts the yyyy-MM-dd date portion from a Graph dateTimeTimeZone dateTime string for display.
Behaviour #
- Runs as the signed-in user (delegated flow) — retrieves only that user’s own tasks.
- All tasks are fetched in a single GET request; filtering is applied in VBA after parsing the response with JSONConverter.
- HTTP 200 OK is the success response.
- The
Tasksalias in the URL resolves to the list withwellknownListName: defaultList. - Tasks with no due date set are excluded when the due date filter is active.
- Completed tasks (
status: completed) are excluded by default unlessblnShowCompleted = True. - Display fields per task: title, status, importance, due date (omitted if not set).
- An interactive browser sign-in is required on first use or when the cached token has expired.
Notes #
- No application permissions —
Tasks.Readis delegated only. - Server-side OData
$filteris not used; all filtering is client-side for reliability, as the Graph docs do not confirm$filtersupport onimportanceordueDateTimefor this endpoint. - Admin consent for
Tasks.Readis typically required in organisational tenants. - The correct HTTP success code is 200 OK.
- The
Tasks.Readscope is read-only; no tasks are modified by this feature.
VBAuth, developed and maintained by Andrew Richards (The IT Service Ltd) and Peter Bryant (Corylus Business Systems), © 2025–2026. All rights reserved. https://vbauth.com