Simon Kearns was telling us:
Simon Kearns nous racontait que :
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
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
'_______________________________________
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org