PDA

View Full Version : PPT 2003 Macro to 2007?



K3MPO
05-29-2008, 12:27 PM
Hi all...I am new here and need your help drastically. I am in the USAF and they just upgraded my systems to office 2007. Originally the macro that we use within our presentations pulls 2 images from the net and crops/sizes the images to insert into a briefing (weather).
This macro was made with the ever-loved macro recorder in Office 2003.
I can no longer run this macro in 2007 :( I have tried to copy and paste the code in the VBA editor and run it and it errrors. Can some one please take a look at this code and tell me what I need to change to make this work.

I am trying to learn VBA now as I have "VBA for Dummies" 5th edition. Thank you for your help and support in this matter.


Sub Ani_Radar_Sat()
'
' Macro recorded 9/25/2006 by TSgt Wesson
'
ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="URL_TO_IMG_HERE", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=75, Top:=83, Width:=570, Height:=375).Select
With ActiveWindow.Selection.ShapeRange
.IncrementLeft 75#
.IncrementTop -22.5
End With
With ActiveWindow.Selection.ShapeRange
.ScaleWidth 0.63, msoFalse, msoScaleFromBottomRight
.ScaleHeight 0.63, msoFalse, msoScaleFromTopLeft
End With
With ActiveWindow.Selection.ShapeRange
.ScaleWidth 0.97, msoFalse, msoScaleFromBottomRight
.ScaleHeight 0.97, msoFalse, msoScaleFromTopLeft
End With
With ActiveWindow.Selection.ShapeRange
.ScaleWidth 1.01, msoFalse, msoScaleFromBottomRight
.ScaleHeight 1#, msoFalse, msoScaleFromTopLeft
End With
ActiveWindow.Selection.ShapeRange.ScaleWidth 1.03, msoFalse, msoScaleFromBottomRight
ActiveWindow.Selection.ShapeRange.ScaleWidth 0.97, msoFalse, msoScaleFromTopLeft
ActiveWindow.Selection.ShapeRange.ScaleWidth 0.99, msoFalse, msoScaleFromTopLeft
ActiveWindow.Selection.ShapeRange.IncrementLeft 1.25
ActiveWindow.Selection.ShapeRange.IncrementLeft -0.88
ActiveWindow.Selection.ShapeRange.IncrementLeft 0.88
ActiveWindow.Selection.ShapeRange.IncrementLeft -1#
ActiveWindow.Selection.ShapeRange.ScaleHeight 1#, msoFalse, msoScaleFromTopLeft
ActiveWindow.Selection.ShapeRange.ScaleHeight 0.98, msoFalse, msoScaleFromTopLeft
ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="URL_TO_IMG_HERE", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=60, Top:=17, Width:=600, Height:=506).Select
With ActiveWindow.Selection.ShapeRange
.ScaleWidth 0.47, msoFalse, msoScaleFromBottomRight
.ScaleHeight 0.47, msoFalse, msoScaleFromBottomRight
End With
With ActiveWindow.Selection.ShapeRange
.IncrementLeft -18#
.IncrementTop -225.12
End With
ActiveWindow.Selection.ShapeRange.ScaleHeight 0.93, msoFalse, msoScaleFromTopLeft
ActiveWindow.Selection.ShapeRange.ScaleHeight 1.01, msoFalse, msoScaleFromTopLeft
ActiveWindow.Selection.ShapeRange.ScaleHeight 1#, msoFalse, msoScaleFromTopLeft
ActiveWindow.Selection.ShapeRange.ScaleWidth 1.23, msoFalse, msoScaleFromTopLeft
ActiveWindow.Selection.ShapeRange.IncrementTop 3.12
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementLeft 1.5
ActiveWindow.Selection.ShapeRange.IncrementLeft 6#
ActiveWindow.Selection.ShapeRange.IncrementLeft -2.7
ActiveWindow.Selection.ShapeRange.IncrementLeft -6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop 6#
ActiveWindow.Selection.ShapeRange.IncrementTop -3.12
ActiveWindow.Selection.ShapeRange.IncrementTop -6#
ActiveWindow.Selection.ShapeRange.IncrementTop -1.88
ActiveWindow.Selection.ShapeRange.IncrementTop -1#
ActiveWindow.Selection.Unselect
End Sub

K3MPO
05-29-2008, 09:35 PM
I see 15 people have seen this..am I barking up the wrong tree?

is this a wrong statement in 2007?


ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="URL_TO_IMG_HERE", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=75, Top:=83, Width:=570, Height:=375)
All I want to do is add 2 animated gifs and then resize/crop them...it should be simple but I am up to chapter 4 in my VBA for dummies book and I am still no closer than when I started :(

Andy Pope
05-30-2008, 02:13 AM
Se my reply to your other post at OzGrid.
http://www.ozgrid.com/forum/showthread.php?t=92420

An read the forum rule on cross posting.

K3MPO
05-30-2008, 07:49 AM
Thank you Andy..as for cross posting...I had no idea that the 2 sites were even related.

I will work on this when I get to work in about 2 hours.

THANK YOU AGAIN!

Andy Pope
05-30-2008, 08:15 AM
The forums are not related, not that that would count for anything.

Really, read the cross posting rules.
http://vbaexpress.com/forum/showthread.php?t=18537

K3MPO
05-30-2008, 11:32 AM
Got it.. sorry about that. I replied and need assistance with the crosspost.

Crosspost:
See link in Andy's post as I have to post 5 times to even be allowed to add a URL.