L
Lance Hoffmeyer
why isn't re.search recognizing "file"? I can print the contents of "file".
import win32com.client
import re
D=MSWord.Documents.Open('C:/test/Test.doc')
file=D.Content
print file
match = re.search('(Table ?)', file)
if match:
print "Table Number is: ", match.group(1)
Traceback (most recent call last):
File "test.py", line 21, in ?
match = re.search('(Table ?)', file)
File "C:\Python24\Lib\sre.py", line 134, in search
return _compile(pattern, flags).search(string)
TypeError: expected string or buffer
import win32com.client
import re
D=MSWord.Documents.Open('C:/test/Test.doc')
file=D.Content
print file
match = re.search('(Table ?)', file)
if match:
print "Table Number is: ", match.group(1)
Traceback (most recent call last):
File "test.py", line 21, in ?
match = re.search('(Table ?)', file)
File "C:\Python24\Lib\sre.py", line 134, in search
return _compile(pattern, flags).search(string)
TypeError: expected string or buffer