2007年12月29日 星期六 19:51
ÎÒÏÖÔÚÏëͨ¹ýwin32comÐÞ¸ÄÒ»¸öwordÀïÃæµÄÒ»¸ö±í¸ñÄÚÈÝ¡£
µ«ÊÇÕâ¸ö±í¸ñÊÇÔÚÒ»¸öÎı¾¿òÀïÃæµÄ,ËùÒÔÖ±½Óͨ¹ýdoc.Tables»ñÈ¡²»ÁË¡£
import win32com
from win32com.client import Dispatch, constants
msword = Dispatch('Word.Application')
doc = msword.Documents.Open(FileName="E:/test1.doc")
print "number of tables =",len(doc.Tables)
>>number of tables = 0
ÎҲ²âÊDZØÐëÏÈ»ñÈ¡µ½Õâ¸öÎı¾¿ò£¬È»ºó½øÒ»²½²ÅÄÜ»ñÈ¡µ½Õâ¸ö±í¸ñ¡£µ«ÊDz»ÖªµÀÈçºÎ»ñÈ¡.
лл!
ywllyht
2007-12-29
-------------- 下一部分 --------------
Ò»¸öHTML¸½¼þ±»ÒƳý...
URL: http://python.cn/pipermail/python-chinese/attachments/20071229/4e84cbe2/attachment.html
Zeuux © 2025
京ICP备05028076号