The from win32com. Client import Dispatch, constants
Word=win32com. Client. Dispatch (' word. Application)
Doc=word. The Documents. The Open (r 'G: \ virtual_env \ apricot 82. Doc')
T=doc. Tables [5]
D1=t.R ows [0]. Cells [0]. Range. The Text
Can get the word form data, but can't get into the word in the excel forms of data in the form of
By using this, please advice, thanks a lot
CodePudding user response:
Excel table in a word, is not necessarily the tabular form, because it may be wrong page, more appropriate is ole object form, so we won't be able to retrieve them in form,CodePudding user response:
I received a Word document is like this, a lot of pages, but there is one page side-by-side, this page is only one form, double-click the form is opened in the form of Excel spreadsheets, I need some data is read from the table, but doc. Tables method cannot realize data acquisition, so,,,,CodePudding user response:
Double click will open in excel, appears to be the ole object, this is unable to get data, there will not be Tables into the object,