View Single Post
 
Old 03-24-2018, 04:45 AM
Bluebell Bluebell is offline Windows 8 Office 2010 64bit
Novice
 
Join Date: Jan 2014
Posts: 10
Bluebell is on a distinguished road
Default Wrap text code not working

I have writing a manual and need to insert a lot of screen prints. I have go the following code to fix the aspect ratio and add the required border which works fine.
I find that although my setting are for Top and Bottom alignment this does not always work when I drag the images in so wanted to add a line of code to change the image type to Top and Bottom alignment

I am using Word 2016 running Windows 10. My code is as follows but I get Compile error: Method or data member not found when I add the wrap format line. Can someone please point out what I am doing wrong please
Many thanks


HTML Code:
Sub AllShapes()
' Sets all selected shapes to Locked Aspect Ratio
Dim oSh As Shape
Dim oSl As InlineShape
 
   For Each oSh In ActiveDocument.Shapes
            oSh.LockAspectRatio = True
            
   Next
   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)
            
            oSl.WrapFormat.Type = wdWrapTopBottom 'Compile error with this line of code            
           
   Next

 
End Sub
Reply With Quote