001.
<html>
002.
<head>
003.
<title>ThaiCreate.Com PHP & PowerPoint.Application</title>
004.
</head>
005.
<body>
006.
<?php
007.
008.
009.
$ppLayoutBlank
= 12;
010.
$ppLayoutChart
= 8;
011.
$ppLayoutChartAndText
= 6;
012.
$ppLayoutClipartAndText
= 10;
013.
$ppLayoutClipArtAndVerticalText
= 26;
014.
$ppLayoutFourObjects
= 24;
015.
$ppLayoutLargeObject
= 15;
016.
$ppLayoutMediaClipAndText
= 18;
017.
$ppLayoutMixed
= -2;
018.
$ppLayoutObject
= 16;
019.
$ppLayoutObjectAndText
= 14;
020.
$ppLayoutObjectAndTwoObjects
= 30;
021.
$ppLayoutObjectOverText
= 19;
022.
$ppLayoutOrgchart
= 7;
023.
$ppLayoutTable
= 4;
024.
$ppLayoutText
= 2;
025.
$ppLayoutTextAndChart
= 5;
026.
$ppLayoutTextAndClipart
= 9;
027.
$ppLayoutTextAndMediaClip
= 17;
028.
$ppLayoutTextAndObject
= 13;
029.
$ppLayoutTextAndTwoObjects
= 21;
030.
$ppLayoutTextOverObject
= 20;
031.
$ppLayoutTitle
= 1;
032.
$ppLayoutTitleOnly
= 11;
033.
$ppLayoutTwoColumnText
= 3;
034.
$ppLayoutTwoObjects
= 29;
035.
$ppLayoutTwoObjectsAndObject
= 31;
036.
$ppLayoutTwoObjectsAndText
= 22;
037.
$ppLayoutTwoObjectsOverText
= 23;
038.
$ppLayoutVerticalText
= 25;
039.
$ppLayoutVerticalTitleAndText
= 27;
040.
$ppLayoutVerticalTitleAndTextOverChart
= 28;
041.
042.
043.
$wdColorLightGreen
=
"&HCCFFCC"
;
044.
$wdColorBlue
=
"&HFF0000"
;
045.
046.
$ppApp
=
new
COM(
"PowerPoint.Application"
);
047.
048.
$strPath
=
realpath
(
basename
(
getenv
(
$_SERVER
[
"SCRIPT_NAME"
])));
049.
$ppName
=
"MyPP/MyPPt.ppt"
;
050.
051.
$ppPres
=
$ppApp
->Presentations->Add();
052.
053.
$ppSlide1
=
$ppPres
->Slides->Add(1,
$ppLayoutTitleOnly
);
054.
055.
$ppSlide1
->Shapes->AddTextbox(1,50,100,700,100);
056.
$ppSlide1
->Shapes(1)->TextFrame->TextRange->Text =
"I Love ThaiCreate.Com 1"
;
057.
$ppSlide1
->Shapes(1)->TextFrame->TextRange->Font->Name =
"Arial"
;
058.
$ppSlide1
->Shapes(1)->TextFrame->TextRange->Font->Size = 10;
059.
$ppSlide1
->Shapes(1)->TextFrame->TextRange->Font->Color =
$wdColorLightGreen
;
060.
061.
$ppSlide1
->Shapes->AddTextbox(1,50,150,700,100);
062.
$ppSlide1
->Shapes(2)->TextFrame->TextRange->Text =
"I Love ThaiCreate.Com 2"
;
063.
$ppSlide1
->Shapes(2)->TextFrame->TextRange->Font->Name =
"Arial"
;
064.
$ppSlide1
->Shapes(2)->TextFrame->TextRange->Font->Size = 20;
065.
066.
067.
$ppSlide1
->Shapes->AddTextbox(1,50,200,700,100);
068.
$ppSlide1
->Shapes(3)->TextFrame->TextRange->Text =
"I Love ThaiCreate.Com 3"
;
069.
$ppSlide1
->Shapes(3)->TextFrame->TextRange->Font->Name =
"Arial"
;
070.
$ppSlide1
->Shapes(3)->TextFrame->TextRange->Font->Size = 30;
071.
072.
$ppSlide1
->Shapes->AddTextbox(1,50,250,700,100);
073.
$ppSlide1
->Shapes(4)->TextFrame->TextRange->Text =
"I Love ThaiCreate.Com 4"
;
074.
$ppSlide1
->Shapes(4)->TextFrame->TextRange->Font->Name =
"Arial"
;
075.
$ppSlide1
->Shapes(4)->TextFrame->TextRange->Font->Size = 40;
076.
077.
$ppSlide1
->Shapes->AddTextbox(1,50,300,700,100);
078.
$ppSlide1
->Shapes(5)->TextFrame->TextRange->Text =
"I Love ThaiCreate.Com 5"
;
079.
$ppSlide1
->Shapes(5)->TextFrame->TextRange->Font->Name =
"Arial"
;
080.
$ppSlide1
->Shapes(5)->TextFrame->TextRange->Font->Size = 50;
081.
$ppSlide1
->Shapes(5)->TextFrame->TextRange->Font->Color =
$wdColorBlue
;
082.
083.
$ppApp
->Presentations[1]->SaveAs(
$strPath
.
"/"
.
$ppName
);
084.
085.
086.
$ppApp
->Quit;
087.
$ppApp
= null;
088.
089.
090.
091.
092.
093.
094.
095.
096.
097.
098.
099.
100.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
121.
122.
123.
124.
125.
126.
127.
128.
129.
130.
131.
132.
133.
134.
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
145.
146.
147.
148.
149.
150.
151.
?>
152.
PowerPoint Created <a href=
"<?php echo $ppName?>"
>Click here</a> to Download.
153.
</body>
154.
</html>