v0.6.0 BigUpdate
This commit is contained in:
@@ -34,16 +34,19 @@ def _open_in_word(path: str) -> bool:
|
||||
import win32com.client # type: ignore
|
||||
except ImportError:
|
||||
return False
|
||||
word = None
|
||||
from ..word_fix import word_com_apartment
|
||||
|
||||
try:
|
||||
word = win32com.client.DispatchEx("Word.Application")
|
||||
word.Visible = True
|
||||
word.Documents.Open(path)
|
||||
return True
|
||||
with word_com_apartment():
|
||||
word = win32com.client.DispatchEx("Word.Application")
|
||||
try:
|
||||
word.Visible = True
|
||||
word.Documents.Open(path)
|
||||
return True
|
||||
finally:
|
||||
word = None
|
||||
except Exception:
|
||||
return False
|
||||
finally:
|
||||
pass # keep Word open for the user
|
||||
|
||||
|
||||
def _open_in_soffice(soffice_path: str, path: str) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user