lahuva
07-08-2011, 11:35 AM
Hello. I am new to this forum, new to Powerpoint, and especially new to Powerpoint macros and now sadly Record macro is gone.
Basically I need to attach a pdf to a page (step one), resize it (step two), and then open a new page (step three) and do the same again until I attach my five pdfs to five pages. I need to attach the same reports updated monthly. Rather than manually attach the reports I would like to do this automatically.
I believe I can do step two (thanks to a short and sweet web land tutorial - ActiveWindow.Selection.ShapeRange.Width = 500) and step three (thanks to VBA Express site: Set Sld = Pre.Slides.Add(Index:=Pre.Slides.Count + 1, Layout:=ppLayoutText) but not step one.
In Excel the code for step one would be
ActiveSheet.OLEObjects.Add Filename:="Q:\GPMS\LFA\Queries\AC Query Results\Top 50 Clients Pie.pdf", Link:=False, DisplayAsIcon:=False
However just replacing ActiveSheet with ActivePresentation does not seem to work in Powerpoint as there is not an OLEObjects choice.
Does anyone have the powerpoint vba code to do this or have any other suggestions?
Thanks
Leah
Basically I need to attach a pdf to a page (step one), resize it (step two), and then open a new page (step three) and do the same again until I attach my five pdfs to five pages. I need to attach the same reports updated monthly. Rather than manually attach the reports I would like to do this automatically.
I believe I can do step two (thanks to a short and sweet web land tutorial - ActiveWindow.Selection.ShapeRange.Width = 500) and step three (thanks to VBA Express site: Set Sld = Pre.Slides.Add(Index:=Pre.Slides.Count + 1, Layout:=ppLayoutText) but not step one.
In Excel the code for step one would be
ActiveSheet.OLEObjects.Add Filename:="Q:\GPMS\LFA\Queries\AC Query Results\Top 50 Clients Pie.pdf", Link:=False, DisplayAsIcon:=False
However just replacing ActiveSheet with ActivePresentation does not seem to work in Powerpoint as there is not an OLEObjects choice.
Does anyone have the powerpoint vba code to do this or have any other suggestions?
Thanks
Leah