I want to use something like the following to manipulate outlook in python, which seems to work for other people. When I type 'win32', 'dispatch' comes up in the dropdown as an available function. But 'GetNameSpace' and 'Create Item' don't appear in the dropdown - why?
I've had the same problem in other projects and it always ends up being a sticking point. Have I just not set up the module correctly?
import win32com.client as win32
outlook = win32.Dispatch('outlook.application')
outlookNS = outlook.GetNameSpace("MAPI")
mail = outlook.CreateItem(0)
mail.To = 'To address'
mail.Subject = 'Message subject'
mail.Body = 'Message body'
mail.Send()
Note that I am using Spyder, Python 3.9. Thank you