Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-09-2017, 09:30 AM
Mattia Mattia is offline Make a macro apply only on selected pictures Windows 8 Make a macro apply only on selected pictures Office 2016
Novice
Make a macro apply only on selected pictures
 
Join Date: Nov 2017
Posts: 2
Mattia is on a distinguished road
Default Make a macro apply only on selected pictures

Hello everyone,



I am using a MACRO to resize all the pictures in my word document :


Code:
Sub Macro1()
For Each image In ActiveDocument.InlineShapes
image.Width = 115
Next
End Sub
The MACRO works pretty well but apply to my whole document and then to all the pictures.

I would like this MACRO to apply only on my selection (I select a part with text and pictures) and then to only change the size of the selected pictures.

I hope someone could help me with that

Thanks

See you
Reply With Quote
  #2  
Old 11-09-2017, 01:40 PM
macropod's Avatar
macropod macropod is offline Make a macro apply only on selected pictures Windows 7 64bit Make a macro apply only on selected pictures Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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 Macro1()
Dim Image As InlineShape
For Each Image In Selection.InlineShapes
  Image.Width = 115
Next
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-10-2017, 12:52 AM
Mattia Mattia is offline Make a macro apply only on selected pictures Windows 8 Make a macro apply only on selected pictures Office 2016
Novice
Make a macro apply only on selected pictures
 
Join Date: Nov 2017
Posts: 2
Mattia is on a distinguished road
Default It is working. Thank you

Hello,
Thank you very much Macropod, You saved my day, it is working perfectly.
Have a great day
Bye
Reply With Quote
Reply

Tags
macro help



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can i make excel retrieve selected text? peterpiper Excel 1 07-11-2017 03:49 AM
Make a macro apply only on selected pictures Macro to apply artistic effect to selected picture in Microsoft Word 2010. staicumihai Word VBA 2 11-24-2016 01:41 AM
How to make outlook rules apply to outbox folder? 1466211 Outlook 0 04-19-2016 05:18 AM
how do i apply any change to all pictures in one document greenil Word 0 06-18-2013 12:56 AM
Make a macro apply only on selected pictures Macro to apply style to selected tables ubns Word 1 08-02-2012 04:09 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:20 PM.


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