mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-05-03 20:34:43 +00:00
Fix errors in Word file parsing.
This commit is contained in:
parent
6a2fcf8ae9
commit
1e15e55689
2 changed files with 4 additions and 1 deletions
|
|
@ -920,7 +920,7 @@ class UrlBase (object):
|
|||
try:
|
||||
app = winutil.get_word_app()
|
||||
try:
|
||||
doc = winutil.open_word(app, filename)
|
||||
doc = winutil.open_wordfile(app, filename)
|
||||
try:
|
||||
for link in doc.Hyperlinks:
|
||||
url_data = get_url_from(link.Address,
|
||||
|
|
|
|||
|
|
@ -65,6 +65,9 @@ def get_word_app ():
|
|||
"""Return open Word.Application handle, or None on error."""
|
||||
if not has_word():
|
||||
return None
|
||||
# Since this function is called from different threads, initialize
|
||||
# the COM layer.
|
||||
pythoncom.CoInitialize()
|
||||
import win32com.client
|
||||
app = win32com.client.gencache.EnsureDispatch("Word.Application")
|
||||
app.Visible = False
|
||||
|
|
|
|||
Loading…
Reference in a new issue