I am working on formatting of tables present in the word document.
For formatting, I have used CTRL+G and selected “Table” under Goto. “Next” button is used for going to next table.
I have included flow decision to format all the tables. But once the last table reaches, it does not throw any error. So it is impossible to end the workflow. The last table gets formatted infinite times.
Please help me in finding the last table in word Document. Even count of tables also helps.
Thank you very much for the sample.
I tried to run it on my PC, but it unfortunately does not work.
It seems a bit complex, and the algorithm is completely different from the one I’m using, which is the one we are talking about in this topic: basically using the shortcut CTRL+G to travel through the tables. And there is no way to detect the last table: basically there is no way to stop CTRL+G and the last table is iterated endlessly.
Yes, there is no way to stop Ctrl+G. It keeps on running.
Operations need to be included in the loop once the last table reaches it will come out of the loop.
Inside the loop:
First, copy the table header and save it in a variable say SELECTED_PREV_TEXT.
Then if you need to perform some operation, you can include here.
Again copy the table header, save it as SELECTED_NEW_TEXT.
For tables other than last table, two variables doesn’t match.
For last table, variables have same value. So it comes out of loop.
One drawback in this algorithm is for last table Find Next in Ctrl +G is performed twice. So all the operations inside the loop also will be performed twice.
Write line can be used to check variable values which will be more helpful in understanding.