This can absolutely be done programmatically. I just added the ability to do that using PowerPoint for Windows yesterday in my uv/python tool `markdown-pptx`. Codex added the functionality in less than 5 minutes.
It uses Office for Windows, so it is Windows only. I don't currently have access to a Mac machine, so I can't build in Mac support yet.