Select a particular table in word during export

Does anyone know how to index to a given table in word during an export ?

What I mean is, supposing I am progressing through my word export, and I have exported 5 tables, is there any way I can go back and get a handle on the second table, so that I could then get a handle on a given row in that table.

I know how to get the row handle for the last table exported as follows...........



vbaCheckRes(oleGet(objTable, cPropertyRows, objRows))
if (null objRows) {
ack "Failed to get rows collection"
}

clear objArgBlock
put(objArgBlock, rowNo)

vbaCheckRes(oleMethod(objRows, cMethodItem, objArgBlock, objRow))
if (null objRow) {
ack "Failed to get row object"
}


.........but this supposes that I already have the handle for the table 'objTable'. What I want to do is set 'objTable' to be some table other than the latest one exported.
I was thinking I could get hold of the 'tables collection' then index though them, but I can't seem to find the correct incantaion.


// Get a handle on the tables collection
checkRes(oleGet(objDoc,cPropertyTables,objTables))
if (null objTables) {
ack "Unable to get tables collection"
}

Any ideas?

Thanks
Andrew.
SystemAdmin - Fri Oct 02 02:42:22 EDT 2009

Re: Select a particular table in word during export
adevicq - Fri Oct 02 10:55:52 EDT 2009

Hi,

I have never tried, but why don't you keep your objTable handles in a skip list (befor you destroy them) so that you can reuse them afterwards ?

Alain

Re: Select a particular table in word during export
Zetareticuli - Wed Oct 14 10:12:47 EDT 2009

It adds an extra step to the whole export process, but in my opinion if you want to do post processing on a word document it's a lot easier to create a macro in word and write the VBA directly. Theoretically, everything you can do in the word VBA macro should be doable from DOORS by accessing the various classes that are available, but I don't know if I would personally go that route. Even if you are dead set on doing it that way though, it might be advantageous to do it in Word first anyway so you can test it and verify that you have all the correct commands. Then you can translate those commands into DXL...