Text box in a table cell - How!

C

ChrisUK

Hi.

Wonder if anyone can help me please

I have a word document which is a complex table made up of many cells
and nested tables.

I'm getting data from a database and wish to populate a number of table
cells in my document. If I could add a textbox to each cell it would be
simple - textbox.text = "xxx"

Problem is I can't seem to add a textbox to a table cell !! Neither can
I name the table cell in such a way I can access it from VB.

Anyone help me please ?

Thanks
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Chris,

There are a number of ways to do this: -

1. ActiveDocument.Tables(1).Cell(Rownum, Colnum).Range.InsertBefore "xxx"

2. Insert a bookmark in the Cell into which you want to place the
information and use

ActiveDocument.Bookmarks("Bookmarkname").Range.InsertBefore "xxx"

3. Insert a { DOCVARIABLE "varname" } field in the cell and use the
following code to populate the variable

ActiveDocument.Variables("varname").Value = "xxx"
ActiveDocument.Fields.Update


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 

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