View Single Post
 
Old 09-07-2020, 04:42 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Again based on your example, you could process all the cells in column 1 e.g. as follows (this works with your table without upsetting row 2).



Code:
Sub Macro2()
Dim ocell As Cell
Dim oInlineShape As InlineShape
Dim oShape As Shape
Dim i As Integer
    For i = 1 To ActiveDocument.Tables(1).Rows.Count
        Set ocell = ActiveDocument.Tables(1).Cell(i, 1)
        Set oInlineShape = ocell.Range.InlineShapes(1)
        Set oShape = oInlineShape.ConvertToShape
        oShape.Rotation = 360
        oShape.ConvertToInlineShape
    Next i
    Set oInlineShape = Nothing
    Set oShape = Nothing
    Set ocell = Nothing
End Sub
or if you only want to process some of the rows then


Code:
Sub Macro3()
Dim ocell As Cell
Dim oInlineShape As InlineShape
Dim oShape As Shape
Dim i As Integer
    For i = 1 To ActiveDocument.Tables(1).Rows.Count
        Select Case i
            Case 1, 2, 3, 13, 15, 22, 57
                Set ocell = ActiveDocument.Tables(1).Cell(i, 1)
                Set oInlineShape = ocell.Range.InlineShapes(1)
                Set oShape = oInlineShape.ConvertToShape
                oShape.Rotation = 360
                oShape.ConvertToInlineShape
            Case Else
        End Select
    Next i
    Set oInlineShape = Nothing
    Set oShape = Nothing
    Set ocell = Nothing
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote