01.
<%
Option
Explicit %>
02.
<html>
03.
<head>
04.
<title>ThaiCreate.Com ASP & PowerPoint.Application</title>
05.
</head>
06.
<body>
07.
<%
08.
09.
Const
ppLayoutTitleOnly = 11
10.
11.
Dim
ppApp,ppPres,ppSlide1,ppName
12.
Set
ppApp = Server.CreateObject(
"PowerPoint.Application"
)
13.
14.
ppName =
"MyPP/MyPPt.ppt"
15.
16.
Set
ppPres = ppApp.Presentations.Add(1)
17.
18.
Set
ppSlide1 = ppPres.Slides.Add(1,ppLayoutTitleOnly)
19.
20.
ppSlide1.Shapes.AddTextbox 1,50,100,700,100
21.
ppSlide1.Shapes(1).TextFrame.TextRange.Text =
"I Love ThaiCreate.Com 1"
22.
ppSlide1.Shapes(1).TextFrame.TextRange.Font.Name =
"Arial"
23.
ppSlide1.Shapes(1).TextFrame.TextRange.Font.Size = 10
24.
25.
ppSlide1.Shapes.AddTextbox 1,50,150,700,100
26.
ppSlide1.Shapes(2).TextFrame.TextRange.Text =
"I Love ThaiCreate.Com 2"
27.
ppSlide1.Shapes(2).TextFrame.TextRange.Font.Name =
"Arial"
28.
ppSlide1.Shapes(2).TextFrame.TextRange.Font.Size = 20
29.
30.
ppSlide1.Shapes.AddTextbox 1,50,200,700,100
31.
ppSlide1.Shapes(3).TextFrame.TextRange.Text =
"I Love ThaiCreate.Com 3"
32.
ppSlide1.Shapes(3).TextFrame.TextRange.Font.Name =
"Arial"
33.
ppSlide1.Shapes(3).TextFrame.TextRange.Font.Size = 30
34.
35.
ppSlide1.Shapes.AddTextbox 1,50,250,700,100
36.
ppSlide1.Shapes(4).TextFrame.TextRange.Text =
"I Love ThaiCreate.Com 4"
37.
ppSlide1.Shapes(4).TextFrame.TextRange.Font.Name =
"Arial"
38.
ppSlide1.Shapes(4).TextFrame.TextRange.Font.Size = 40
39.
40.
ppSlide1.Shapes.AddTextbox 1,50,300,700,100
41.
ppSlide1.Shapes(5).TextFrame.TextRange.Text =
"I Love ThaiCreate.Com 5"
42.
ppSlide1.Shapes(5).TextFrame.TextRange.Font.Name =
"Arial"
43.
ppSlide1.Shapes(5).TextFrame.TextRange.Font.Size = 50
44.
45.
ppSlide1.Shapes.AddPicture Server.MapPath(
"thaicreate-2009.gif"
),0,1,250,330,200,188
46.
47.
ppApp.Presentations(1).SaveAs(Server.MapPath(ppName))
48.
ppApp.Quit
49.
Set
ppApp =
Nothing
50.
51.
%>
52.
PowerPoint Created <a href=
"<%=ppName%>"
>Click here</a> to Download.
53.
</body>
54.
</html>