01-29-2016 09:43 AM
I have experinced a snafu when executing this labview program that reads in all tables within an MS Word file and does not see some of the tables. The original Word document has hundreds of tables in it and it would erratically skip a table in the sequence when it read in and executed the convert to text method.
I whittled the thing down to a simple word file doing the same thing. This VI does not see the second table in this word document with 2 tables. The tables count property calculates as 2 indicating that Word sees 2 tables in the document, but when I try to convert to text the second table I get the infamous error indication from MS Word and an empty string out of the converttotext method.
Anybody know how to remedy this?
Solved! Go to Solution.
01-29-2016 11:42 AM - edited 01-29-2016 11:47 AM
hi id,
the error occours in the inner for loop.
for one .docx:
get rid of the inner for loop, replace the outer for loop with a while loop, stop this while loop when i +1 = count
01-29-2016 11:49 AM
This is a tricky one. Here you are modifying the document (by using convert to text) and at the end you don't save the changes.
When you convert a table to text the table no longer exist and Word reassign the table indices. So in your example after table 1 is converted to text index 1 is reassign to table 2. In the second iteration you are trying to get the table with index 2 which no longer exist.
You can modify your code as follow to make it work: Wire the Tables -> Count value to the N terminal of the FOR loop, Wire the constant "1" to the Tables Item Index value.
Ben64
01-29-2016 12:56 PM
You did it again Ben thanks