scripting - PowerPoint VBA: which command (or a set of commands) would create ppt frames out of my .jpg pictures? -
i have few .jpg files in c:\my_folder
here names: pic_1.jpg , pic_2.jpg , pic_3.jpg , pic_4.jpg , pic_5.jpg .
what command or group of commands in power point vba should use in order able automatically create several frames in powerpoint each frame contain 1 picture?
this vbscript creates new powerpoint presentation , adds 2 slides it, each picture. need adjust picture's location , size suit taste. you'll need utilize scripting.filescriptingobject enumerate images if want automatically grab whatever pictures exist in directory embedding presentation. if want script can save presentation calling pptpresentation.saveas
after slides generated.
the msdn documentation located @ http://msdn.microsoft.com/en-us/library/ff746873.aspx.
dim pptdoc dim pptpresentation dim pptslide set pptdoc = wscript.createobject( "powerpoint.application" ) pptdoc.visible = true set pptpresentation = pptdoc.presentations.add( true ) ' add new slide blank layout end of slides collection ' 12 = pplayoutblank set pptslide = pptpresentation.slides.add( pptpresentation.slides.count + 1, 12 ) ' add picture slide, saving picture powerpoint document ' 10, 10 left , top coordinates respectively pptslide.shapes.addpicture "c:\fullpath\1.jpg", false, true, 10, 10 ' add slide picture set pptslide = pptpresentation.slides.add( pptpresentation.slides.count + 1, 12 ) pptslide.shapes.addpicture "c:\fullpath\2.jpg", false, true, 10, 10
Comments
Post a Comment