Results 1 to 4 of 4

Thread: Can you create dynamic PowerPoint files on the fly with ASP and/or COM on the server?

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    5

    Question 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

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    First off, rather than the asp page in which your limited to using late binding :
    VB Code:
    1. 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:
    1. Dim objPPApp As PowerPoint.Application
    2. Set objPPApp = New PowerPoint.Application
    3.  
    4. objPPApp.Presentations.Add
    5. objPPApp.Presentations(1).SaveAs _
    6. "C:\MyNewlyCreatedPPPresentation.ppt"
    7.  
    8. 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!

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538
    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

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  4. #4

    Thread Starter
    New Member
    Join Date
    Nov 2002
    Posts
    5

    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
  •  



Click Here to Expand Forum to Full Width