A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Can I create a macro to crop a picture?



 
 
Thread Tools Display Modes
  #1  
Old May 6th, 2010, 12:44 AM posted to microsoft.public.word.docmanagement
Donna
external usenet poster
 
Posts: 565
Default Can I create a macro to crop a picture?

I routinely paste print screens into word. I then crop them so I can enlarge
to easily read. I would like to have a macro to eliminate several key
strokes.
  #2  
Old May 6th, 2010, 05:38 AM posted to microsoft.public.word.docmanagement
macropod[_2_]
external usenet poster
 
Posts: 2,402
Default Can I create a macro to crop a picture?

Hi Donna,

Here's a macro to crop a given amount of each side of a picture and then zoom in by the amount cropped.

Sub Demo()
Dim sngHeight, sngWidth, sngCrop As Single
sngCrop = 0.1
With Selection.InlineShapes(1)
sngHeight = .Height
sngWidth = .Width
With .PictureFormat
.CropLeft = sngWidth * sngCrop
.CropRight = sngWidth * sngCrop
.CropTop = sngHeight * sngCrop
.CropBottom = sngHeight * sngCrop
End With
.Height = .Height * 1 / (1 - sngCrop * 2)
.Width = .Width * 1 / (1 - sngCrop * 2)
End With
End Sub

As coded, the macro crops 10%. from each side. Change the sngCrop = 0.1 value to suit your requirements.

--
Cheers
macropod
[Microsoft MVP - Word]


"Donna" wrote in message ...
I routinely paste print screens into word. I then crop them so I can enlarge
to easily read. I would like to have a macro to eliminate several key
strokes.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:19 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.