Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-20-2011, 08:32 AM
mertulufi mertulufi is offline URGENT!!! Powerpoint Image Formatting and Positioning Macro Windows 7 64bit URGENT!!! Powerpoint Image Formatting and Positioning Macro Office 2007
Novice
URGENT!!! Powerpoint Image Formatting and Positioning Macro
 
Join Date: Dec 2011
Posts: 3
mertulufi is on a distinguished road
Default URGENT!!! Powerpoint Image Formatting and Positioning Macro

Hello,

I'm in great need of a macro that will help me do the following;

Change the height of the picture to 15.5,
Change the width of the picture to 16.09,

Change the horizontal position of the picture to 9,


Change the vertical position of the picture to 3.46.

and give a black shape outline to the image.

If somebody could help me out with this code I will be very grateful. Thank you for your time.
Reply With Quote
  #2  
Old 12-20-2011, 08:46 AM
JohnWilson JohnWilson is offline URGENT!!! Powerpoint Image Formatting and Positioning Macro Windows 7 64bit URGENT!!! Powerpoint Image Formatting and Positioning Macro Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

That doesn't seem too difficult but some more info will help.

15.5 what? cm, inches, points
ditto 16.09 etc

Will the picture be selected?

Black Outline , what line weight?
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #3  
Old 12-20-2011, 09:36 AM
mertulufi mertulufi is offline URGENT!!! Powerpoint Image Formatting and Positioning Macro Windows 7 64bit URGENT!!! Powerpoint Image Formatting and Positioning Macro Office 2007
Novice
URGENT!!! Powerpoint Image Formatting and Positioning Macro
 
Join Date: Dec 2011
Posts: 3
mertulufi is on a distinguished road
Default

all of the figures are in cms and the shape outline is to be black and the picture will be selected.

Thanks...
Reply With Quote
  #4  
Old 12-20-2011, 09:45 AM
JohnWilson JohnWilson is offline URGENT!!! Powerpoint Image Formatting and Positioning Macro Windows 7 64bit URGENT!!! Powerpoint Image Formatting and Positioning Macro Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

OK

PowerPoint works in points in the object model so you need a user defined function to convert your figures to points.
Code:
Sub fix_Pic()
If ActiveWindow.Selection.Type <> ppSelectionShapes Then Exit Sub
With ActiveWindow.Selection.ShapeRange(1)
.Left = cm2Points(9)
.Top = cm2Points(3.46)
.LockAspectRatio = False
.Width = cm2Points(16.09)
.Height = cm2Points(15.5)
.Line.ForeColor.RGB = vbBlack
.Line.Weight = 2 'change weight here
End With
End Sub
Function cm2Points(inVal As Single)
cm2Points = inVal * 28.346
End Function
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote
  #5  
Old 12-20-2011, 10:05 AM
mertulufi mertulufi is offline URGENT!!! Powerpoint Image Formatting and Positioning Macro Windows 7 64bit URGENT!!! Powerpoint Image Formatting and Positioning Macro Office 2007
Novice
URGENT!!! Powerpoint Image Formatting and Positioning Macro
 
Join Date: Dec 2011
Posts: 3
mertulufi is on a distinguished road
Default

Thank you, it works great you saved me from so much work . One last request. Could you write a code that will work for all of the pictures in the slide show?

Thank you very much I'm in great debt.
Reply With Quote
  #6  
Old 12-20-2011, 10:14 AM
JohnWilson JohnWilson is offline URGENT!!! Powerpoint Image Formatting and Positioning Macro Windows 7 64bit URGENT!!! Powerpoint Image Formatting and Positioning Macro Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

This should work on all pics. Obviously if there is more than one pic per slide they will superimpose!

Code:
Sub fix_Pic_all()
Dim opic As Shape
Dim osld As Slide
For Each osld In ActivePresentation.Slides
For Each opic In osld.Shapes
If opic.Type = msoPicture Then
With opic
.Left = cm2Points(9)
.Top = cm2Points(3.46)
.LockAspectRatio = False
.Width = cm2Points(16.09)
.Height = cm2Points(15.5)
.Line.ForeColor.RGB = vbBlack
.Line.Weight = 2
End With
End If
Next opic
Next osld
End Sub
Function cm2Points(inVal As Single)
cm2Points = inVal * 28.346
End Function
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials

Last edited by JohnWilson; 12-21-2011 at 01:58 AM.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Positioning drawing elements in Powerpoint TdeV PowerPoint 2 09-20-2014 06:56 AM
Issues formatting image behind text in Word (Mac 2008). wildberrykt Word 0 11-23-2011 07:12 AM
VBA PowerPoint iBrowse Urgent Help! mike PowerPoint 0 04-04-2011 04:29 PM
URGENT!!! Powerpoint Image Formatting and Positioning Macro Positioning Slide Titles genericusername PowerPoint 3 03-17-2011 05:43 AM
Powerpoint + paste in image with fixed width erki PowerPoint 0 09-19-2010 11:23 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:01 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