PowerPoint Creator //open as readonly myPresentation = presentationsCollection.Open(VARIABLES.basefilepath, True, False, False); //The presentation object has a slides collection if (isDebugMode()) writeOutput("Creating collection"); CollSlides = myPresentation.Slides; //The first param defines the number of slides. //The second parameter defines the slide layout //Figured out blank by trial and error //blank = 12 //blank with title = 11 ObjSlide = CollSlides.Add(1, 11); // This chunk of code creates a title. I know it's a lot just to create a title, but Powerpoint has a lot of classes. slideShape = ObjSlide.Shapes; newShape = slideShape.Title; myTextFrame = newShape.TextFrame; myTextRange = myTextFrame.TextRange; myTextRange.Text = "This is the Title"; // This is how to add more text to the slide. bodyShape = SlideShape.AddTextBox(1, 200, 300, 700, 100); bodyShapeTextFrame = bodyShape.TextFrame; bodyShapeTextRange = bodyShapeTextFrame.TextRange; bodyShapeTextRange.Text = "This is some additional text"; //add table //http://skp.mvps.org/ppttable.htm //AddTable(NumRows, NumColumns, Left, Top, Width, Height) // //Somewhere I read you couldn't stack your arguments (this.that.theother) more than two deep //This doesn't seem to be true. // //Define the most rows that can display on a page imaxrows = 10; //How many rows returned by query? irowct = SomeQuery.RecordCount; //have to account for record count of 0, or we'll have issues //note the nify use of integer division and mod if (irowct GT imaxrows) inumslides = funcnumslides(irowct, imaxrows); function funcnumslides(i1, i2){ inumint = i1 \ i2; inummod = i1 mod i2; if (inummod GT 0) return inumint + 1; else return inumint; } ObjSlide = CollSlides.Add(inumslides, 11); bodyShape = SlideShape.AddTable(imaxrows,1,30,110,660,320); oTable = bodyShape.Table; oCell = oTable.Cell(1,1); try { otext = oCell.Shape.TextFrame.TextRange; rsltText = SomeQuery.RecordCount; otext.Text = rsltText; } catch(Any excpt) { WriteOutput("#excpt.Message#"); } newpresentation = myPresentation.SaveAS(VARIABLES.newfilepath, 11, True); // Close a presentation myPresentation.Close(); //Quit PowerPoint objPPT.Quit();

Your file is ready for download. On opening you will be asked to allow macros. Click OK.