Hi,

I am not sure If I gto the context, it is hard to understand what you
have done witht he limited description.

But I guess you passed a filename to a COM object ?
Try to escape the brackets.
And check for problems arising a) from the different notation
conventions for pathnames and b) differences in unicode treatment in
Python an COM.

Regards
Christoph



Am 08.04.2022 um 04:11 schrieb Jeffery Liao (廖弈全):

Hi,

My docx file name contains brackets ([ and ]) and those brackets were
changed to %5B and %5D after I convert the docx to pdf.

e.g.

before: name_[project_id]_date.docx

after: name_%5Bproject_id%5D_date.pdf

I've searched Document.ExportAsFixedFormat
<https://docs.microsoft.com/en-us/office/vba/api/word.document.exportasfixedformat>
method (Word) and didn't find any option to change this behavior.

Is there any way to keep the brackets in file name?

Version of Python and pywin32:

Python v3.8.10, pywin32 v300

Best regards
Jeffery


This message contains confidential information and is intended only
for the individual(s) addressed in the message. If you aren't the
named addressee, you should not disseminate, distribute, or copy this
e-mail. If you aren't the intended recipient, you are notified that
disclosing, distributing, or copying this e-mail is strictly prohibited.

ACT Genomics Holdings Co. Ltd. and its subsidiaries
<https://www.actgenomics.com/en>


_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to