E
Ed
I was handed a report with a "table" in it. Somehow, either by deliberate
design or by document format conversions, the "table" became a collection of
lines and boxes! I'm working this in Word 2000. The "Select Multiple
Objects" button on the drawing toolbar showed lots of lines and rectangles,
with text assigned to the rectangles.
So I tried a macro to figure out what I've got; if I can find what property
of the shape is holding the text, I can probably get the text out and write
it into a real table. ActiveDocument.Shapes.Count gave me 332. Then I
tried:
Dim obj As Shape
Dim i As Long, j As Long
i = ActiveDocument.Shapes.Count
For j = 1 To j
ActiveDocument.Shapes(j).Select
Set obj = Selection
Debug.Print obj.Type
Next j
It errored on obj.Type!! I added On Error GoTo Next and it went through,
but never recognized the Type property of obj. I removed "As Shape", so obj
was just a Variant, and it gave me a Type number "8" - 332 times! Every
line and rectangle was a Type 8.
This is not a critical item - I've since retyped the whole table by hand!
But for learning purposes, how do I go about working through a situation
like this - trying to find out what I've got and how to work with it?
Ed
design or by document format conversions, the "table" became a collection of
lines and boxes! I'm working this in Word 2000. The "Select Multiple
Objects" button on the drawing toolbar showed lots of lines and rectangles,
with text assigned to the rectangles.
So I tried a macro to figure out what I've got; if I can find what property
of the shape is holding the text, I can probably get the text out and write
it into a real table. ActiveDocument.Shapes.Count gave me 332. Then I
tried:
Dim obj As Shape
Dim i As Long, j As Long
i = ActiveDocument.Shapes.Count
For j = 1 To j
ActiveDocument.Shapes(j).Select
Set obj = Selection
Debug.Print obj.Type
Next j
It errored on obj.Type!! I added On Error GoTo Next and it went through,
but never recognized the Type property of obj. I removed "As Shape", so obj
was just a Variant, and it gave me a Type number "8" - 332 times! Every
line and rectangle was a Type 8.
This is not a critical item - I've since retyped the whole table by hand!
But for learning purposes, how do I go about working through a situation
like this - trying to find out what I've got and how to work with it?
Ed