Finding a table in a word doc.

J

Jason

I am currently tring to find a table in a word doc using execl automation. I
can not find the first table.
 
P

Perry

?
dim tbl as word.table
set tbl = wdapp.activedocument.tables(1)

If the activedocument has a table (or more), above lines
will give you a pointer to the first table.
(provided wdapp is a valid object variable pointing to the word instance
y've instantiated in yr Excel code)


Krgrds,
Perry
 
J

Jason

thanks, Is there a easier way to skip a row and copy the next one and paste
it on another doc.
--
Thanks
Jason


Perry said:
?
dim tbl as word.table
set tbl = wdapp.activedocument.tables(1)

If the activedocument has a table (or more), above lines
will give you a pointer to the first table.
(provided wdapp is a valid object variable pointing to the word instance
y've instantiated in yr Excel code)


Krgrds,
Perry
 
P

Perry

Sure but

Skip a row?
Under which circumstances?
Or just skip a row?
Meaning get data from second row?

If the latter, something like below code will do

Dim tbl as word.table
dim cel as word.cell
Set tbl = wdapp.activedocument.tables(1)
for each cel in tbl.rows(2).cells
Debug.print cel.range
next

Krgrds,
perry

Jason said:
thanks, Is there a easier way to skip a row and copy the next one and
paste
it on another doc.
 

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