View Single Post
 
Old 03-25-2018, 03:44 AM
Bluebell Bluebell is offline Windows 8 Office 2010 64bit
Novice
 
Join Date: Jan 2014
Posts: 10
Bluebell is on a distinguished road
Default Word Wrap still not working

I now have a macro which I think converts to a shape, but when I then try and align the shape it still does not recognise the "shapes". I get an unqualified error. Any clues gratefully received. Also how do I know whether a shape is a shape or an inline shape? or an inline shape just that selection on the wrap text button?
HTML Code:
Sub AllShapes()
'add a blue thin border and locks aspect ratio
Dim oSh As Shape
Dim oSl As InlineShape
 
  
   For Each oSl In ActiveDocument.InlineShapes
            oSl.LockAspectRatio = True
            oSl.Line.Weight = 2
            oSl.Line.Style = msoLineSingle
            oSl.Line.ForeColor.RGB = RGB(91, 155, 213)
         
      Next
      
 Call ConvertToShape
 Call TopBottomAlign
 
End Sub

Sub ConvertToShape()
Dim i As Integer, oShp As InlineShape

For i = ActiveDocument.InlineShapes.Count To 1 Step -1
    Set oShp = ActiveDocument.InlineShapes(i)
    oShp.Select

    With Selection
    
                If oShp.Type = wdSelectionInlineShape Then
            .InlineShapes(1).ConvertToShape
            
        End If
    
    End With
    Next i
End Sub

Sub TopBottomAlign()
Dim shp As Shape
For Each shp In ActiveDocument.Shapes
           .WrapFormat.Type = wdWrapTopBottom ' unqualified error occurs here
        Next
End Sub
Reply With Quote