Is it possible to send a file to Microsoft OneNote from Python? (Maybe using its COM object?) I don't need to store it in a specific notebook or page, I just want OneNote to pop-up a window where I can choose the destination.
Asked
Active
Viewed 3,724 times
3 Answers
1
I found several links with a simple google... http://blogs.msdn.com/b/descapa/archive/2011/06/16/onenote-amp-python-using-onenote-com-api-with-python.aspx for example. did those not work?

adahlin
- 126
- 2
-
Well, ish. I had seen that page. I think there are tiny mistakes in their code but it gives you some ideas. – Milad Mar 28 '13 at 17:04
0
The blogs aren't linked on the site any longer. But here's the corresponding GitHub Repo

Tim Reilly
- 142
- 3
- 9
0
This code sends a PDF file to the OneNote printer.
import win32print
import subprocess
import time
pdf_file = 'D:\d1\d1.pdf'
acrobat = 'C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe'
name = win32print.GetDefaultPrinter()
cmd = '"{}" /n /h /s /o /t "{}" "{}"'.format(acrobat, pdf_file, name)
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)