Increasing brightness of all pictures by 10%

A

andreas

Word 2007

Dear Experts:

I would like to increase the brightness of all pictures of my
documents by 10%. How is this done using VBA.

Help is much appreciated. Thank you very much in advance.

Regards,

Andreas
 
G

Graham Mayor

Something like the following might work, depending on where your pictures
were located in the document.

With ActiveDocument
For i = 1 To .InlineShapes.Count
If .InlineShapes(i).Type = wdInlineShapePicture Then
.InlineShapes(i).PictureFormat.Brightness = _
.InlineShapes(i).PictureFormat.Brightness + 0.1
End If
Next i
For i = 1 To .Shapes.Count
If .Shapes(i).Type = msoPicture Then
.Shapes(i).PictureFormat.Brightness = _
.Shapes(i).PictureFormat.Brightness + 0.1
End If
Next i
End With

However why do you need to do this? It would be better if you investigated
why the pictures were not bright enough in the first place. Is this a
display issue, a printer problem or just poor photography?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
A

andreas

Something like the following might work, depending on where your pictures
were located in the document.

With ActiveDocument
    For i = 1 To .InlineShapes.Count
        If .InlineShapes(i).Type = wdInlineShapePicture Then
            .InlineShapes(i).PictureFormat.Brightness = _
            .InlineShapes(i).PictureFormat.Brightness + 0.1
        End If
    Next i
    For i = 1 To .Shapes.Count
        If .Shapes(i).Type = msoPicture Then
            .Shapes(i).PictureFormat.Brightness = _
            .Shapes(i).PictureFormat.Brightness + 0.1
        End If
    Next i
End With

However why do you need to do this? It would be better if you investigated
why the pictures were not bright enough in the first place. Is this a
display issue, a printer problem or just poor photography?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>







- Zitierten Text anzeigen -

Dear Graham,

ok, thank you very much for your professional help. One strange thing.
I had to change the 0.1 to 0.05 to get a 10% increase. That is, 0.1
results in a 20% increase in brightness. Strange isn't it?
Anyhow, to answer your question: It is poor photography which makes me
do this.

Thank you again for your terrific help. Regards, Andreas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top