Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42220

Changing Picture settings

$
0
0
Hi everyone.
I am writing a macro in vb6 that opens a Word 2010 document, accesses a particular picture ("Picture 2") and changes its brightness. My code is:

sub ChangePictureBrightness()

Dim wrdapp As Word.Application, wrdoc As Word.Document, shps As Word.Shapes, shp As Word.Shape

Set wrdapp = CreateObject("Word.Application")

Set wrdoc = wrdapp.Documents.Open("c:\2013 Reports Term 2\07H\SPE0001.docx")

Set shps = wrdoc.Shapes

wrdoc.Shapes("Picture 2").PictureFormat.Brightness = 0.65

wrdoc.Close True

wrdapp.Quit

Set wrdoc = Nothing

Set wrdapp = Nothing

end sub

Unfortunately, when I open the document the picture brightness setting does not change to 65%. It remains at its original setting(98%). I tried creating a Word macro from within Word in order to see the code generated but once the recording of the macro starts, I cannot highlight the picture with the mouse.

Anyone have an idea?

Regards,
Tim Christopher

Viewing all articles
Browse latest Browse all 42220

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>