Question : Microsoft Word 2003 - Using VBA - After inserting picture how do you adjust Picture - Contrast - 60 percent?

Microsoft Word 2003 - Using VBA - After inserting picture how do you adjust Picture - Contrast - 60 percent?  I also would like to get the VBA to adjust Layout -Behind Text which would be great.

Answer : Microsoft Word 2003 - Using VBA - After inserting picture how do you adjust Picture - Contrast - 60 percent?

This will insert a picture at the Selection, change the contrast, convert it from an Inline space and move it behind the text.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
Sub InsertAndFormat()
    Dim sh As Shape
    Dim ilsh As InlineShape
    
    Set ilsh = ActiveDocument.InlineShapes.AddPicture("C:\My Pictures\Picture1.jpg", False, True, Selection.Range)
    ilsh.PictureFormat.Contrast = 0.6
    Set sh = ilsh.ConvertToShape
    sh.WrapFormat.Type = wdWrapNone
    sh.WrapFormat.AllowOverlap = True
    sh.WrapFormat.Side = wdWrapBoth
    sh.ZOrder msoSendBehindText
End Sub
Open in New Window Select All
Random Solutions  
 
programming4us programming4us