S
Steve
I have a two-cell table (two rows, one column). I want to convert a Shape in
Cell 1 (row 1, col 1) to an inline shape. The For Each/Next block below
converts all shapes in the ActiveDocument. I want to only convert the shape
in Cell 1. How can I do this? I can't figure out the object syntax.
Thanks to Doug Robbins for helping me set up AutoText tables and do the
reformatting of the cells based on the InlineShape size (I tweaked the last
line to set the entire column width, not just the Cell 1 width).
Steve Drenker
Sub SetTableDims()
Dim oHeight As Single
Dim oWidth As Single
Dim s As Shape
For Each s In ActiveDocument.Shapes ' <--How do I fix this line to
convert shapes in selected table?
If s.Type = msoPicture Then
s.ConvertToInlineShape
End If
Next s
oHeight = Selection.Tables(1).Cell(1, 1).Range.InlineShapes(1).Height
oWidth = Selection.Tables(1).Cell(1, 1).Range.InlineShapes(1).Width
Selection.Tables(1).Cell(1, 1).Height = oHeight
Selection.Tables(1).Columns(1).Width = oWidth
End Sub
Cell 1 (row 1, col 1) to an inline shape. The For Each/Next block below
converts all shapes in the ActiveDocument. I want to only convert the shape
in Cell 1. How can I do this? I can't figure out the object syntax.
Thanks to Doug Robbins for helping me set up AutoText tables and do the
reformatting of the cells based on the InlineShape size (I tweaked the last
line to set the entire column width, not just the Cell 1 width).
Steve Drenker
Sub SetTableDims()
Dim oHeight As Single
Dim oWidth As Single
Dim s As Shape
For Each s In ActiveDocument.Shapes ' <--How do I fix this line to
convert shapes in selected table?
If s.Type = msoPicture Then
s.ConvertToInlineShape
End If
Next s
oHeight = Selection.Tables(1).Cell(1, 1).Range.InlineShapes(1).Height
oWidth = Selection.Tables(1).Cell(1, 1).Range.InlineShapes(1).Width
Selection.Tables(1).Cell(1, 1).Height = oHeight
Selection.Tables(1).Columns(1).Width = oWidth
End Sub