How can I apply contrast & brightness settings to all photos in a document?

I'm using Microsoft Office Professional Plus 2013. I have 50 photos in a document and I would like to change brightness & contrast settings to all of them (identical settings) but it doesn't allow me to select more than 1 photo at a time.  Is there a way to do this?

Thanks,

Vera

Answer
Answer

A similar macro will set all the pictures, both inline and floating, except for any that have already been modified through either the Picture Tools > Corrections gallery or the Format Pictures dialog:

Sub ReproPhotoSettings()
    Dim newBright As Single
    Dim newContrast As Single
    Dim ILS As InlineShape
    Dim shp As Shape
    
    newBright = Val(InputBox("Enter brightness (-100 to 100):", _
        "Brightness", 0)) / 200 + 0.5
    newContrast = Val(InputBox("Enter contrast (-100 to 100):", _
        "Contrast", 0)) / 200 + 0.5
    
    For Each ILS In ActiveDocument.InlineShapes
        With ILS.PictureFormat
            .Brightness = newBright
            .Contrast = newContrast
        End With
    Next
        
    For Each shp In ActiveDocument.Shapes
        With shp.PictureFormat
            .Brightness = newBright
            .Contrast = newContrast
        End With
    Next
End Sub

The bug, which appears in both Word 2010 and 2013, has disconnected the picture format controls in the user interface from the PictureFormat object in the macro language -- neither one can see any changes made by the other. If you want to affect all the images in the document, they all have to be reset (use the Reset Picture button on the Picture Tools tab).

_____________________________
https://jay-freedman.info

2 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated May 18, 2024 Views 5,892 Applies to: