View Single Post
 
Old 11-12-2012, 08:48 AM
AndyDDUK AndyDDUK is offline Windows 7 64bit Office 2010 64bit
Advanced Beginner
 
Join Date: Oct 2012
Posts: 32
AndyDDUK is on a distinguished road
Default URGENT VBA needed for placing image on page

Hi
Can you make two amendments to the code below,if so it would be greatly appreciated?

1) so it places/aligns the bottom of the image so it is 11cm from the top
2) so instead of being 30% of the original size, it scales height to 171.5 and reduces width accordingly to scale

Full code as below:
Sub ATopLeft()
Dim oshp1 As Shape
Dim oshp2 As Shape
If ActiveWindow.Selection.ShapeRange.Count <> 2 Then Exit Sub
Set oshp1 = ActiveWindow.Selection.ShapeRange(1)
Set oshp2 = ActiveWindow.Selection.ShapeRange(2)
oshp1.Width = oshp1.Width * 0.30
oshp2.Width = oshp2.Width * 0.30
oshp1.Top = cm2Points(2)
oshp2.Top = cm2Points(2)
oshp2.Left = oshp1.Left + oshp1.Width
ActiveWindow.Selection.ShapeRange.Cut
With ActivePresentation.Slides(ActiveWindow.View.Slide. SlideNumber).Shapes.PasteSpecial(ppPastePNG)
.Left = cm2Points(7) - .Width / 2
.Top = cm2Points(6) - .Height / 2
.Top = cm2Points(10)
.Line.Visible = True
.Line.ForeColor.RGB = RGB(0, 176, 80)
.Line.Weight = 3
End With
End Sub


Cheers
Andy
Reply With Quote