I’d like to ask a question about modifying/updating the table of contents (toc) in word using python, and if it complies with VIKTOR. Previously, we ran into a problem that certain code windows environment, but not in Linux, such as the code snippet below. Will it work on VIKTOR platform when the app is published?
Thanks in advance!
def update_toc(file_path_to_docx: str): # TODO: package win32com does not exist in linux. Fix for Linux is yet to found word = win32com.client.DispatchEx("Word.Application") doc = word.Documents.Open(file_path_to_docx) doc.TablesOfContents(1).Update() doc.Close(SaveChanges=True) word.Quit()