I'm trying to create a simple docx to pdf converter and it throws me this problem:
Exception has occurred: com_error (-2147352567, 'Exception occurred.', (0, 'Microsoft Word', 'Sorry, we couldn’t find your file. Is it possible it was moved, renamed or deleted?\r (C:\Windows\system32\document1.docx)', 'wdmain11.chm', 24654, -2146823114), None)
import os
filesToConvertPath = os.getcwd() + r'\docxFiles'
folderWithPdfFIles = os.getcwd() + r'\pdfFiles'
for i in range(len(os.listdir(filesToConvertPath))):
convert(os.listdir(filesToConvertPath)[i], folderWithPdfFIles)
.py file is in the main folder, with 2 subfolders, docxFiles and pdfFiles