web 2.0

How to use ASP & PowerPoint - Create Multiple Slides

How to use ASP & PowerPoint - Create Multiple Slides This is learn/tutorial asp developers how to using ASP script Create PowerPoint and Create Multiple Slides

ShotDev Focus:
- ASP & Create PowerPoint and Create Multiple Slides

Example

asp_ppt_multi_slice.asp


<% Option  Explicit %>
<html>
<head>
<title>ShotDev.Com Tutorial</title>
</head>
<body>
<%
'*** Constant ***'
Const ppLayoutBlank = 12
Const ppLayoutChart = 8
Const ppLayoutChartAndText = 6
Const ppLayoutClipartAndText = 10
Const ppLayoutClipArtAndVerticalText = 26
Const ppLayoutFourObjects = 24
Const ppLayoutLargeObject = 15
Const ppLayoutMediaClipAndText = 18
Const ppLayoutMixed = -2
Const ppLayoutObject = 16
Const ppLayoutObjectAndText = 14
Const ppLayoutObjectAndTwoObjects = 30
Const ppLayoutObjectOverText = 19
Const ppLayoutOrgchart = 7
Const ppLayoutTable = 4
Const ppLayoutText = 2
Const ppLayoutTextAndChart = 5
Const ppLayoutTextAndClipart = 9
Const ppLayoutTextAndMediaClip = 17
Const ppLayoutTextAndObject = 13
Const ppLayoutTextAndTwoObjects = 21
Const ppLayoutTextOverObject = 20
Const ppLayoutTitle = 1
Const ppLayoutTitleOnly = 11
Const ppLayoutTwoColumnText = 3
Const ppLayoutTwoObjects = 29
Const ppLayoutTwoObjectsAndObject = 31
Const ppLayoutTwoObjectsAndText = 22
Const ppLayoutTwoObjectsOverText = 23
Const ppLayoutVerticalText = 25
Const ppLayoutVerticalTitleAndText = 27
Const ppLayoutVerticalTitleAndTextOverChart = 28

Dim ppApp,ppPres,ppSlide1,ppSlide2,ppSlide3,ppSlide4,ppName
Set ppApp = Server.CreateObject("PowerPoint.Application")

ppName = "MyPP/MyPPt.ppt"

Set ppPres = ppApp.Presentations.Add(1)

Set ppSlide1 = ppPres.Slides.Add(1,ppLayoutTitle)
ppSlide1.Shapes(1).TextFrame.TextRange.Text = "Welcome To"
ppSlide1.Shapes(2).TextFrame.TextRange.Text = "www.ShotDev.Com" & vbCr & "Version 2010"

Set ppSlide2 = ppPres.Slides.Add(2,ppLayoutTwoColumnText)
ppSlide2.Shapes(1).TextFrame.TextRange.Text = "www.ShotDev.Com Version"
ppSlide2.Shapes(2).TextFrame.TextRange.Text = "Version 2009" & vbCr &_
"Version 2009"  & vbCr & "Version 2009"  & vbCr & "Version 2009"
ppSlide2.Shapes(3).TextFrame.TextRange.Text = "Version 2010" & vbCr &_
"Version 2010"  & vbCr & "Version 2010"  & vbCr & "Version 2010"

Set ppSlide3 = ppPres.Slides.Add(3,ppLayoutTable)
ppSlide3.Shapes(1).TextFrame.TextRange.Text = "We Love ShotDev.Com"

Set ppSlide4 = ppPres.Slides.Add(4,ppLayoutTextAndChart)
ppSlide4.Shapes(1).TextFrame.TextRange.Text = "We Love ShotDev.Com"
ppSlide4.Shapes(2).TextFrame.TextRange.Text = "2006" & vbCr & "2007" & vbCr & "2008" & vbCr & "2009" & vbCr & "2010"

ppApp.Presentations(1).SaveAs(Server.MapPath(ppName))
ppApp.Quit
Set ppApp = Nothing

%>
PowerPoint Created <a href="<%=ppName%>">Click here</a> to Download.
</body>
</html>

Create a asp file and save to path root-path/myasp/

Run
http://localhost/myasp/asp_ppt_multi_slice.asp

Screenshot

ASP & Create PowerPoint and Create Multiple Slides
.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

Leave a Reply

You must be logged in to post a comment.