Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-27-2013, 01:30 PM
capitala capitala is offline VBA code to trim a picture Windows 7 64bit VBA code to trim a picture Office 2003
Advanced Beginner
VBA code to trim a picture
 
Join Date: Nov 2013
Posts: 38
capitala is on a distinguished road
Default VBA code to trim a picture


I use pictures frequently on Ms Word 2003, I need a code to trim the picture from the top 0.5 cm each time.

How to do that using vba in word 2003?

thanks in advance
Reply With Quote
  #2  
Old 11-28-2013, 05:27 PM
macropod's Avatar
macropod macropod is offline VBA code to trim a picture Windows 7 32bit VBA code to trim a picture Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,359
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi capitala,

Are these pictures inserted in-line with text, or with text-wrapping (eg square)?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 12-02-2013, 01:05 PM
capitala capitala is offline VBA code to trim a picture Windows 7 64bit VBA code to trim a picture Office 2003
Advanced Beginner
VBA code to trim a picture
 
Join Date: Nov 2013
Posts: 38
capitala is on a distinguished road
Default

no, it's only a picture and no wrapping at all.
I insert it by clicking Insert-picture- from file
Reply With Quote
  #4  
Old 12-02-2013, 04:26 PM
macropod's Avatar
macropod macropod is offline VBA code to trim a picture Windows 7 32bit VBA code to trim a picture Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,359
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub CropIt()
On Error Resume Next
With Selection.InlineShapes(1)
  .LockAspectRatio = False
  With .PictureFormat
    .CropLeft = CentimetersToPoints(0.5)
    .CropRight = CentimetersToPoints(0.5)
    .CropTop = CentimetersToPoints(0.5)
    .CropBottom = CentimetersToPoints(0.5)
  End With
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA code to trim a picture How to click on one picture, and another picture will be shown? unsvn Drawing and Graphics 18 09-27-2023 02:36 PM
Move Picture by picture name, rename picture by picture name CatMan PowerPoint 2 04-18-2012 12:21 PM
VBA code to group picture to export as one RenaatS PowerPoint 3 03-05-2012 12:40 PM
Powerpoint automatically changing picture size when adding a picture (2010) One_Life PowerPoint 7 01-20-2012 06:57 AM
Multiple Audio Tracks - Won't trim? Hlogan89 PowerPoint 0 09-12-2010 01:33 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:24 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft