AlJohri / docx2pdf

MIT License
506 stars 96 forks source link

Word File with Comments Freezes Runtime #47

Open SamButterfield opened 2 years ago

SamButterfield commented 2 years ago

Whenever you try convert a docx with comments it freezes the script. Upon investigation it seems like there is some sort of pop-up about "Unsaved Comments" that is not handled, and the function call appears to run forever.

AlJohri commented 2 years ago

@SamButterfield From this answer on StackOverflow, it seems like there may be an easy way to delete all comments. It may be worth adding a flag --delete-all-comments to allow such documents to be converted

# Delete all comments
if word.ActiveDocument.Comments.Count >= 1:
    word.ActiveDocument.DeleteAllComments()

link dump: