agent 模式补充文件功能已经实现

This commit is contained in:
wandering
2026-06-15 10:39:01 +08:00
parent e252896de9
commit 7c137c5214
34 changed files with 1664 additions and 1651 deletions

View File

@@ -154,6 +154,8 @@ def fill_consumable_doc(
import win32com.client
pythoncom.CoInitialize()
word = None
doc = None
try:
word = win32com.client.Dispatch("Word.Application")
word.Visible = False
@@ -213,9 +215,11 @@ def fill_consumable_doc(
doc.Save()
finally:
doc.Close()
word.Quit()
if doc is not None:
doc.Close()
finally:
if word is not None:
word.Quit()
pythoncom.CoUninitialize()
return doc_path