Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Issue publishing a page #15

Open
mantielero opened this issue Mar 25, 2021 · 0 comments
Open

[Question] Issue publishing a page #15

mantielero opened this issue Mar 25, 2021 · 0 comments

Comments

@mantielero
Copy link

one-py, doesn't work for me, so I am just using directly the win32com interface and copying the pieces that I need from your code. I am getting the information that I need so far, but I am struggling to publish a page.

In order to publish a page I am doing:

import win32com.client
onObj = win32com.client.gencache.EnsureDispatch('OneNote.Application.12')
onObj.Publish("{D010194E-057E-406E-8537-24E2144B6030}{1}{B0}", "output.docx", 5, "")

But the last line complains with:

>>> onObj.Publish("{D010194E-057E-406E-8537-24E2144B6030}{1}{B0}", "output.docx", 5, "")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Temp\gen_py\3.7\F2A7EE29-8BF6-4A6D-83F1-098E366C709Cx0x1x0\IApplication.py", line 96, in Publish
    , bstrTargetFilePath, pfPublishFormat, bstrCLSIDofExporter)
  File "C:\Users\cxxxxx\AppData\Local\Continuum\anaconda3\lib\site-packages\win32com\client\__init__.py", line 467, in _ApplyTypes_
    self._oleobj_.InvokeTypes(dispid, 0, wFlags, retType, argTypes, *args),
pywintypes.com_error: (-2147352567, 'Ocurrió una excepción.', (0, None, None, None, 0, -2147213306), None)

"Ocurrió una excepción" means "an exception occured"

Any clue about what am I doing wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant