LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (August 2002, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 28 Aug 2002 10:58:23 -0700
Reply-To:     Andrew Bushmakin <abushmakin@ARGOSE.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Andrew Bushmakin <abushmakin@ARGOSE.COM>
Organization: http://groups.google.com/
Subject:      Re: Exporting SAS graphs to PowerPoint
Content-Type: text/plain; charset=ISO-8859-1

Pedro,

It is relatively simple if you know how to used Visual Basic (which is part of all programs in MS Office).

1) First let's create macro (In Power Point) to add new slide and insert picture from file:

Step 1: menu Tools|Macro|Record New Macro, you should see a window asking you to input name of macro, type AddSlideAndInsertPicture and press OK Step2: You should have small window with just one button to stop recording. But we should here first to add new slide – do this using menu Insert|New Slide; second put picture from file on this slide – again menu Insert|Picture|From File Step 3: you should have new slide with new picture on it right now – stop recording this moment.

As results of these steps we created a couple lines of the VB code – lets look at them – menu Tools|Macro|Visual Basic Editor. You should see module (Module1) and following code inside This code add second slide (Index:=2) and add picture from file "D:\DataAnalysis\TempMaps\gplot99.gif"

Sub MacroAddSideAndInsertPicture() ' ' Macro recorded 8/28/2002 by abushmakin ' ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=2, Layout:=ppLayoutBlank).SlideIndex ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="D:\DataAnalysis\TempMaps\gplot99.gif", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=135, Top:=45, Width:=450, Height:=450).Select

End Sub

We can change now this text to do this job several times (10 in example). I also assumed in this example that pictures named as gplot1.gif, gplot2.gif,… gplot10.gif ad they are in directory "D:\DataAnalysis\TempMaps".

Sub MacroAddSideAndInsertPicture() ' ' Macro recorded 8/28/2002 by abushmakin ' For i = 1 To 10 ActiveWindow.View.GotoSlide Index:=ActivePresentation.Slides.Add(Index:=i, Layout:=ppLayoutBlank).SlideIndex ActiveWindow.Selection.SlideRange.Shapes.AddPicture(FileName:="D:\DataAnalysis\TempMaps\gplot" & i & ".gif", LinkToFile:=msoFalse, SaveWithDocument:=msoTrue, Left:=135, Top:=45, Width:=450, Height:=450).Select Next

End Sub

Delete all slides from this presentation and use this modified macro and you should get 10 slides with pictures. It is only start – just remember that you have incredibly powerful language incorporated in every MS Office program.

Andrew

gerente_usa@hotmail.com (PedroM) wrote in message news:<503138c9.0208271223.77bf1af4@posting.google.com>... > I created 50 graphs using PROC GPLOT. I need to convert them to > Powerpoint. Is there a way to program PowerPoint to import them all > once ? (batch versus one-by-one). I've sucessfully exported one to CGM > format and import it into Power point but i don't want to do it 50 > times ! > > Thank you > > PedroM


Back to: Top of message | Previous page | Main SAS-L page