[python-win32] Automating OneNote/COM without editing the registry

Johnny Birchett johnny at birchetts.com
Sun Mar 8 19:49:23 EDT 2020


I've successfully used pywin32 to automate some OneNote stuff using pywin32
directly and also using onepy, but I ALWAYS have to edit the registry to
"fix" the OneNote key  {0EA692EE-BB50-4E3C-AEF0-356D91732725} as described
in this stackflow answer:
https://stackoverflow.com/questions/16287432/python-pywin-onenote-com-onenote-application-15-cannot-automate-the-makepy-p


On a fresh install of Windows 10 and Office 2019 + OneNote 2016, the
registry looks like the one in the stackoverflow question.

>From time to time, I am on a machine where I don't have admin and I just
can't automate OneNote. Is this a limitation of win32/COM or a limitation
of pywin32? I seem to be able to use automation from powershell as a
non-admin, so I'm not understanding what the problem with makepy is. Also,
I noticed makepy does successfully generate a static proxy .py file, but
when I try to create a onenote object with win32com.client.gencache.
EnsureDispatch('OneNote.Application'), it fails with the typical makepy
error message "COM object can not automate the makepy process". From what I
can tell, powershell is creating a runtime wrapper in a similar way as
pywin32, so it seems like this should be possible, but I don't have enough
experience with python or COM to figure this out. Google is no help because
every answer says "edit the registry". Is that the only answer?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20200308/0d61cf83/attachment-0001.html>


More information about the python-win32 mailing list