<html> <head> <title>ThaiCreate.Com PHP & PowerPoint.Application</title> </head> <body> <?php //*** Constant ***// $ppLayoutBlank = 12; $ppLayoutChart = 8; $ppLayoutChartAndText = 6; $ppLayoutClipartAndText = 10; $ppLayoutClipArtAndVerticalText = 26; $ppLayoutFourObjects = 24; $ppLayoutLargeObject = 15; $ppLayoutMediaClipAndText = 18; $ppLayoutMixed = -2; $ppLayoutObject = 16; $ppLayoutObjectAndText = 14; $ppLayoutObjectAndTwoObjects = 30; $ppLayoutObjectOverText = 19; $ppLayoutOrgchart = 7; $ppLayoutTable = 4; $ppLayoutText = 2; $ppLayoutTextAndChart = 5; $ppLayoutTextAndClipart = 9; $ppLayoutTextAndMediaClip = 17; $ppLayoutTextAndObject = 13; $ppLayoutTextAndTwoObjects = 21; $ppLayoutTextOverObject = 20; $ppLayoutTitle = 1; $ppLayoutTitleOnly = 11; $ppLayoutTwoColumnText = 3; $ppLayoutTwoObjects = 29; $ppLayoutTwoObjectsAndObject = 31; $ppLayoutTwoObjectsAndText = 22; $ppLayoutTwoObjectsOverText = 23; $ppLayoutVerticalText = 25; $ppLayoutVerticalTitleAndText = 27; $ppLayoutVerticalTitleAndTextOverChart = 28; $ppApp = new COM("PowerPoint.Application"); $strPath = realpath(basename(getenv($_SERVER["SCRIPT_NAME"]))); // C:/AppServ/www/myphp $ppName = "MyPP/MyPPt.ppt"; $ppPres = $ppApp->Presentations->Add(); $ppSlide1 = $ppPres->Slides->Add(1,$ppLayoutTitle); $ppSlide1->Shapes(1)->TextFrame->TextRange->Text = "Welcome To"; $ppSlide1->Shapes(2)->TextFrame->TextRange->Text = "www.ThaiCreate.Com".chr(13)."Version 2009"; $ppSlide2 = $ppPres->Slides->Add(2,$ppLayoutTwoColumnText); $ppSlide2->Shapes(1)->TextFrame->TextRange->Text = "www.ThaiCreate.Com Version"; $ppSlide2->Shapes(2)->TextFrame->TextRange->Text = "Version 2008".chr(13)."Version 2008".chr(13). "Version 2008".chr(13)."Version 2008"; $ppSlide2->Shapes(3)->TextFrame->TextRange->Text = "Version 2009".chr(13)."Version 2009".chr(13). "Version 2009".chr(13)."Version 2009"; $ppSlide3 = $ppPres->Slides->Add(3,$ppLayoutTable); $ppSlide3->Shapes(1)->TextFrame->TextRange->Text = "We Love ThaiCreate.Com"; $ppSlide4 = $ppPres->Slides->Add(4,$ppLayoutTextAndChart); $ppSlide4->Shapes(1)->TextFrame->TextRange->Text = "We Love ThaiCreate.Com"; $ppSlide4->Shapes(2)->TextFrame->TextRange->Text = "2005".chr(13)."2006".chr(13)."2007".chr(13)."2008".chr(13)."2009"; $ppApp->Presentations[1]->SaveAs($strPath."/".$ppName); //$ppApp->Presentations[1]->SaveAs(realpath($ppName)); $ppApp->Quit; $ppApp = null; ?> PowerPoint Created <a href="<?php echo $ppName?>">Click here</a> to Download. </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท