|
-
Nov 20th, 2002, 01:03 PM
#1
Thread Starter
New Member
Can you create dynamic PowerPoint files on the fly with ASP and/or COM on the server?
Hello All,
I've got a question regarding PowerPoint and ASP. We've got a client who we are creating an online training system for. Data for modules and lessons will be stored in a database and the primary viewing of the content will be with with ASP generated dynamic web pages.
This is not a problem. The problem is that they also want to be able to have a button/link that when you click it will allow them to download a Microsoft PowerPoint version of the data. Basically we would need to get all of the data from the database and then write to a new PowerPoint file and save it to the server directory and redirect the browser to that file so they could download it.
Does anyone know how to do this? Is there an easy, or even hard, way to do this? I've checked for 3rd party ASP compoenents to do this any only found one that could create dynamic Adobe Acrobat files. Surely there has to be a way to do this through COM to automate the PowerPoint API.
Any help with this would be greatly appreciated.
Thanks,
Chris
-
Nov 20th, 2002, 02:05 PM
#2
First off, rather than the asp page in which your limited to using late binding :
VB Code:
server.createobject("powerpoint.application")
Try writing your code to create the file in a vb dll file, then call on this code from your asp page. look at the following page for this...
http://www.vbforums.com/showthread.p...ht=dll+and+asp
Once you use this, you can goto the project menu & add the "Microsoft Powerpoint x.0 Object Library" to gain access to all the powerpoint objects.
This'll get you started with powerpoint - very basic code to create & save a new presentation.
VB Code:
Dim objPPApp As PowerPoint.Application
Set objPPApp = New PowerPoint.Application
objPPApp.Presentations.Add
objPPApp.Presentations(1).SaveAs _
"C:\MyNewlyCreatedPPPresentation.ppt"
Set objPPApp = Nothing
To go further than this, I'd suggest cheating! Powerpoint allows you to create macros the same way as Excel does. Start powerpoint, record a new macro & do your data importing & saving, then stop the macro recording & hit Alt+F11 to pinch the code the macro created for you!
-
Nov 20th, 2002, 02:08 PM
#3
Oh yeah, the other site which might help you out is this one - the Ms OfficeDev homepage - not fantastically overloaded with samples but you find what your after 1/2 the time! 
http://msdn.microsoft.com/library/de...entid=28000550
-
Nov 20th, 2002, 05:35 PM
#4
Thread Starter
New Member
Thanks
Hey thanks for all the help out there. Definitely pointed me in the right direction. It may not be a simple shootover but I definitely feel better about the possibility of doing this functionality now.
--Chris
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|