You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VBA-MicrosoftGraph makes working with the Microsoft Graph REST API from VBA easier. Built on VBA-Web (v4.1.6), it handles Microsoft Identity (OAuth2) authentication and provides a high-level API for mail, calendar, contacts, and groups — all from Microsoft Access VBA.
Features
Mail
Function
Description
CreateDraftMessage
Create a draft message with To/CC/BCC recipients and file attachments
SendDraft
Send a previously created draft by message ID
GraphSendMail
Compose and send a message in a single call
SendMailAs
Send email as / on behalf of another address
ListMessages
List messages in a mail folder with optional $select projection
├── Src/
│ ├── Graph.bas Main API — all Graph operations
│ ├── PKCE.bas Proof Key for Code Exchange (RFC 7636)
│ ├── AttachmentHelpers.bas Base64 encoding for file attachments
│ ├── TimeZoneHelpers.bas Windows ↔ IANA time zone mapping
│ ├── WebHelpers.bas VBA-Web utilities
│ ├── WebClient.cls HTTP client (WinHttp)
│ ├── WebRequest.cls HTTP request builder
│ ├── WebResponse.cls HTTP response wrapper
│ └── Dictionary.cls VBA Dictionary polyfill
├── authenticators/
│ ├── GraphAuthenticator.cls Graph-specific OAuth2 (auth code, client creds, device code)
│ └── OAuth2Authenticator.cls Generic OAuth2 base authenticator
├── Forms/
│ ├── Form_SendEmail.cls Send email UI
│ ├── Form_CreateEvent.cls Create event UI
│ ├── Form_CreateContact.cls Create contact UI
│ ├── Form_ListMessages.cls List messages UI
│ └── Form_ListContacts.cls List contacts UI
├── AccessAndGraph.accdb Sample database with all modules + forms
├── EVALUATION.md Technical audit and change log
└── LICENSE MIT License
What's New in v2.7
To Do — Full CRUD
List — ListTaskLists returns all To Do task lists (id, displayName, wellknownListName)
Create — CreateTaskList creates a new named task list
Read — ListToDoTasks lists tasks in a specific list; GetToDoTask retrieves a single task by ID
Create — CreateToDoTask creates a task in any list (title, body, dueDate, importance, status) — replaces the legacy CreateTask which hardcoded the default "Tasks" list
Update — UpdateToDoTask patches any task fields via a Dictionary (status, title, dueDateTime, importance, etc.)
Delete — DeleteToDoTask removes a task by ID
Planner — Plans, Tasks & Buckets
Plans — ListPlannerPlans lists plans for an M365 group; GetPlannerPlan retrieves a plan by ID (returns @odata.etag)
Tasks — ListPlannerPlanTasks lists tasks in a plan; CreatePlannerTask creates a task with optional bucket, assignee, priority (0–10), and due/start dates; GetPlannerTask retrieves a task (returns @odata.etag); UpdatePlannerTask patches task fields (requires sEtag from prior GET for If-Match header)
Buckets — ListPlannerBuckets lists board columns (buckets) in a plan
Fix — ListPlannerTasks now includes retry loop with 429 throttle handling (was missing)
OneNote — Notebooks, Sections & Pages
Navigate — ListOneNoteSections lists sections in a notebook; ListOneNotePages lists pages in a section
Read — GetOneNotePageContent retrieves page content as raw HTML (uses PlainText format, not JSON)
Create — CreateOneNotePage creates a page from HTML content (Content-Type: text/html); CreateOneNoteNotebook creates a new notebook
Fix — ListOneNoteNotebooks now includes retry loop with 429 throttle handling (was missing)
Note — OneNote API does not support app-only (client_credentials) authentication — delegated permissions only
New OAuth Scopes
Tasks.ReadWrite — To Do task lists and tasks (read/write)
Notes.ReadWrite — OneNote notebooks, sections, and pages (read/write)
Notes
All 19 new functions include retry loops with 429 throttle handling and token refresh
2 existing functions (ListPlannerTasks, ListOneNoteNotebooks) upgraded with retry loops
Error numbers: 11390–11590 (non-overlapping with v2.6's 11260–11380)
Planner PATCH/DELETE require If-Match etag header — call GetPlannerTask first to obtain the etag
No new Planner scopes needed — existing Group.ReadWrite.All covers all Planner operations
What's New in v2.6
Contacts — Read & Manage
Read — GetContact retrieves a single contact by ID with optional $select field projection
Delete — DeleteContact removes a contact by ID
Folders — ListContactFolders lists all contact folders; CreateContactFolder creates new folders (supports nested child folders via sParentFolderId)
Groups — Read & Manage Members
List — ListGroups searches/filters groups with ConsistencyLevel: eventual for advanced queries
Read — GetGroup retrieves a single group by ID with optional $select
Members — ListGroupMembers lists direct members; AddGroupMember adds a user; RemoveGroupMember removes a member
Owners — ListGroupOwners lists group owners
User Profile & Directory — Lookup
Read — GetUser retrieves any user's profile by ID or UPN (always uses /users/{id} regardless of grant type)
Search — ListUsers searches the directory with $filter, $search, $select, and $top (uses ConsistencyLevel: eventual for advanced queries)
People — ListPeople returns people ranked by communication relevance (useful for autocomplete and suggestions)
New OAuth Scopes
User.Read.All — read any user profile
People.Read — access relevance-ranked people list
GroupMember.ReadWrite.All — add/remove group members
Notes
All 13 functions include retry loops with 429 throttle handling and token refresh
Error numbers: 11260–11380 (non-overlapping with v2.5's 11130–11250)
What's New in v2.5
Mail — Read & Organize
Read — GetMessage retrieves a single message with optional $select field projection
Update — UpdateMessage patches message properties: mark read/unread (isRead), set categories, flag status, importance, and inference classification
Move — MoveMessage moves a message to any folder using well-known names (Inbox, DeletedItems, Drafts, SentItems, Archive) or folder IDs
Folders — ListMailFolders lists all mail folders with $select and $top support
Mail — Reply & Forward
Reply — ReplyToMessage replies to the sender with a comment and optional additional recipients
Reply All — ReplyAllToMessage replies to all recipients
Forward — ForwardMessage forwards a message to new recipients with an optional comment
Calendar — Read & RSVP
Read — GetEvent retrieves a single event with optional $select
Accept — AcceptEvent accepts a meeting invitation with optional comment and response control
Decline — DeclineEvent declines a meeting invitation
Tentative — TentativelyAcceptEvent tentatively accepts a meeting invitation
Forward — ForwardEvent forwards a calendar event to new recipients (PascalCase body keys per Graph spec)
Free/Busy — GetFreeBusySchedule checks availability for multiple users/rooms over a time range with configurable interval
Notes
No new OAuth scopes required — all 13 functions use existing Mail.ReadWrite, Mail.Send, Calendars.ReadWrite, and Calendars.ReadWrite.Shared scopes
All write/action functions include retry loops with 429 throttle handling and token refresh
Error numbers: 11130–11250 (non-overlapping with v2.4's 11060–11120)
What's New in v2.4
SharePoint Lists CRUD
Read — GetSite, ListSiteLists, ListSiteListItems with $expand=fields(select=...), $filter, and $top
Write — CreateListItem, UpdateListItem, DeleteListItem with retry loops
Scopes — Sites.Read.All, Sites.ReadWrite.All added to authorization_code flow
Access VBA can now read/write SharePoint lists as an external data source
OneDrive Files & Folders
Browse — ListDriveChildren with $select, $top, $orderby