D
Dave S
I'm trying to return the node points of a freeform shape.
I've keep getting 'type mismatch error'.
Dim Tbox As Shape
Dim Pict As InlineShape
Dim x As Single
Dim y As Single
Dim J As Integer
Dim pointsArray As Variant
For Each Pict In ActiveDocument.InlineShapes
Pict.Select
Pict.Activate
For Each Tbox In ActiveDocument.Shapes
If UCase(Left(Tbox.Name, 9)) = "FREEFORM " Then
Tbox.Select
For J = 1 To Tbox.Nodes.Count
ReDim pointsArray(0 To Tbox.Nodes.Count - 1, 0 To 1)
pointsArray = Tbox.Nodes(J).Points 'Error occurs here
x = pointsArray(J, 0)
y = pointsArray(J, 1)
Next J
x = Tbox.Name
End If
Next Tbox
ActiveDocument.Close
Next Pict
Points is supposed to return a coordinate pair.
I've tried Dim as single, double, int, variant, no Dim,
Dim pointsArray(), etc.
I've also tried every concievable permutation of
dimensions in the redim. The example given in the help
doesn't work. Is this a bug?
Help!
I've keep getting 'type mismatch error'.
Dim Tbox As Shape
Dim Pict As InlineShape
Dim x As Single
Dim y As Single
Dim J As Integer
Dim pointsArray As Variant
For Each Pict In ActiveDocument.InlineShapes
Pict.Select
Pict.Activate
For Each Tbox In ActiveDocument.Shapes
If UCase(Left(Tbox.Name, 9)) = "FREEFORM " Then
Tbox.Select
For J = 1 To Tbox.Nodes.Count
ReDim pointsArray(0 To Tbox.Nodes.Count - 1, 0 To 1)
pointsArray = Tbox.Nodes(J).Points 'Error occurs here
x = pointsArray(J, 0)
y = pointsArray(J, 1)
Next J
x = Tbox.Name
End If
Next Tbox
ActiveDocument.Close
Next Pict
Points is supposed to return a coordinate pair.
I've tried Dim as single, double, int, variant, no Dim,
Dim pointsArray(), etc.
I've also tried every concievable permutation of
dimensions in the redim. The example given in the help
doesn't work. Is this a bug?
Help!