> For example: tblMyTable instead of tables(1)
>
[quoted text clipped - 4 lines]
> I mean rather the same way you give name to controls on forms.
> e.g. txtLastName instead of TextBox1
Hi Simon,
In short, you can't. The best you can do is mark a table with a bookmark and
then work from that, like this
Dim tblMyTable
Set tblMyTable =
ActiveDocument.Bookmarks("MyMeaningfulBookmark").Range.Tables(1)

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Simon Kearns - 16 Feb 2005 20:43 GMT
Hi Jonathan.
OK. That's Bad.
I need to populate a 'tree diagram' (like a family tree for example) with
Excel data and later insert it into a powerpoint presentation.
I was planning on using text boxes connected by drawn lines to make the
tree. There would be 10-12 of them and they need to be able to be moved
around sometimes. So the text boxes would be distributed vertically and
horizontally.
Does word name objects based on location or creation order? Does the
numbering change (e.g. if I move the box around)? Maybe a table would work
better? We are trying to use word to take advantage of formatting features
and to keep code out of a distributed PowerPoint presentaion but maybe word
is not the application for this job?
Anyway, these are things that I will go away and ponder but any thoughts
most appreciated.
Cheers
Simon
>> For example: tblMyTable instead of tables(1)
>>
[quoted text clipped - 13 lines]
> Set tblMyTable =
> ActiveDocument.Bookmarks("MyMeaningfulBookmark").Range.Tables(1)
Jean-Guy Marcil - 17 Feb 2005 00:09 GMT
Simon Kearns was telling us:
Simon Kearns nous racontait que :
> Hi Jonathan.
> OK. That's Bad.
[quoted text clipped - 14 lines]
> Cheers
> Simon
This is different from naming tables (which can't be named).
You can name a textbox if you create it through VBA.
For example:
'_______________________________________
Const TxtBx As String = "TextBox"
'_______________________________________
Sub CreateBox()
Dim MyTextBox As Shape
Set MyTextBox = ActiveDocument.Shapes. _
AddTextbox(msoTextOrientationHorizontal, 180#, _
144#, 198#, 135#)
With MyTextBox
.Name = TxtBx
.TextFrame.TextRange.Text = "Text box #1."
End With
End Sub
'_______________________________________
'_______________________________________
Sub DeleteBox()
ActiveDocument.Shapes(TxtBx).Delete
End Sub
'_______________________________________

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org