accessing table within a textbox

S

Steve

How do you reference a table within a textbox in a word
2000 document

I use ......
wordapp.activedocument.storyranges(wdMainTextstory).tables
(2).cell(1,1).range.text
but this fails, presumably because the table is within a
textbox


Regards
Steve
 
P

Perry

Use textrange property of the Shapes().textframe
like examplified below to access tables in a textframe/box

? activedocument.Shapes(1).TextFrame.TextRange.Tables(1).Cell(1,1).Range
zxc


Krgrds,
Perry
 
C

Cindy M -WordMVP-

Hi Steve,
How do you reference a table within a textbox in a word
2000 document

I use ......
wordapp.activedocument.storyranges(wdMainTextstory).tables
(2).cell(1,1).range.text
but this fails, presumably because the table is within a
textbox
Yes, that's correct. You need to get the Range within the
Textbox SHAPE object in order to access anything in it.
Roughly:

doc = wordapp.activedocument
tbl = doc.Shapes(Index).TextFrame.TextRange.Tables(2)
tbl.cell(1,1).Range.Text = "Hi"

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

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