Trying to access a table, the following gives me an error
lole_temp = iole_word.ActiveDocument.Tables(1).Select
Error: Error calling external object function tables
All I am trying to do is get a tables content. The table is created next to a bookmark so I need a way to use the bookmark as a reference (starting) point to then get access to the table so I can validate some info in its cells.
Above code was just a way to test if I can at least connect to a table., using table count I do get count of 4 so I know there are tables there.
PB17 R3, Office Pro..
Glad you got it to work with René's approach and he is correct about not being able to use the Tables(1) format but I just wanted to point out the issue is more about the type of brackets being used rather than the short access approach.
For any collections square [] brackets must be used (from within PB) and if you had used these in your initial code it would select the table without an error.
When using the Item method, which is not referring to a collection but rather a single table, it doesn't matter that you use round brackets (). Actually, in this case when using the Item method you can use either round or square brackets and it will work but I tend to leave square brackets for collections for readability.
Regards...Mark
good to know.
Thanks.