Best method 2 search for text within tables

D

Devhead

i have tables(number of tables vary) within my word document and it contains
text(header text, general label text, etc.) that i need to key off of in
order to "grab it" and populate the table with field values from an SQL
server database. i know how to retrieve the field data but what is the best
method to "find" the table text in question and then insert the db field
values at the appropriate cell within the table. here's what i'm thinking
about, but i don't know if it's the best approach:

1. determine if there are any tables in the document. if so, go to step 2.
if not, abort.
2. cycle through all the tables in the document(each column and each row)
looking for the "text" that tells me that it's the table that i want. i
didn't design the original document template or i would have placed
bookmarks instead. so can't key off of bookmarks or any other "tag".
3. when find table, populate it with field values.
4. pray that it isn't slow.

another thing that is potentially a problem is there is no way to a) prevent
user from moving these tables around b) "lock" them down so they cannot be
deleted. if there is, i would like to know how.

thanks.

devhead
 
J

Jim Vierra

Put a password on the document. It will protect anything you want it to
protect and let ares you want to have edited be edited.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top