1

I have this file that contains values from sharepoint's document set, which in turns creates a .docx file with values that are under 'content control'.

I am looking to convert all 'content control' words to normal words so i can replace the values using docxtpl.DocxTemplate. The issue I face now is that DocxTemplate does not read values that are under 'content control' so I am unable to replace the text. Is there a workaround for this issue that I have?

I have tried converting the docx to doc file (using os.rename) but the document set values were missing, this can be done manually and it works though. (link to this method: https://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_win10-mso_o365b/remove-content-controls-in-word/9d9a8711-f7d8-4b3d-819a-2ba731e4f811)

  • `os.rename` will not change the file content. So even though the filename will end in .doc, the contents will still have the format of a docx document. Using MS Word to convert the file manually is indeed the right way. In case you want to automate the conversion: https://stackoverflow.com/a/48832989/3653185 – pj.dewitte Mar 14 '22 at 11:28

0 Answers0