Does anyone have any experience in opening many Word docs and saving them to PDF, but when they're on a shared server and it may be possible that someone else is editing them at the moment, but you still want to go through and save the PDF?
I have some code using comtypes as follows, which works for files that aren't being edited by another user on the shared drive, but will fail if any of the docs are currently open by a coworker, as they open as read only and i cannot save.
word=comtypes.client.CreateObject(Word.Application)
word.Visible = 1
input_file_path = input_file_path
doc = word.Documents.Open(input_file_path)
file_name = os.path.splitext(input_file_name)[0]
output_file_path = output_file_path
doc.SaveAs(output_file_path,32)
doc.Close()
word.Quit()