Disable PowerPoint features using C#

前端 未结 6 1704
抹茶落季
抹茶落季 2021-01-27 06:36

My scenario: I have a requirement in my project(C#).I need to give the user only reading capability for my powerpoint presentation opened thru my application.All other

相关标签:
6条回答
  • 2021-01-27 06:51

    If you have a low number of powerpoint presentations, you can look into Information Rights Management or use the Permissions Object. (Disclaimer:I have not used this)

    0 讨论(0)
  • 2021-01-27 06:51

    Assuming that you're using Powerpoint Automation. Get hold of the PowerPoint.Application object and then loop through the CommandBars property and for each command bar, set Visible to false.

    This should remove the command bars at least. And there might be other properties on the Application object that lets you disable context menus, but I've never really used powerpoint, so I'm not sure which ones.

    I don't think that there's any good way of disabling printing etc altogether though. However, this MS KB article discusses a hacky way of dismissing any dialogs automatically, so assuming that the print/save etc would always bring up a dialog (which I'm not sure off) you might be able to use something from there: How To Dismiss a Dialog Box Displayed by an Office Application with Visual Basic

    It's all VB code in that article, but the ideas will be similar.

    0 讨论(0)
  • 2021-01-27 06:54

    You should use the Powerpoint COM component, kind of like whats described here... Using C# to display powerpoint I have only used Word and Excel ones, and i must say they are extremely easy to use.

    Or is you MUST make it completely read-only, id suggest writing your own ODF parser, or investigating in the ODF COM component, maybe that could work as well :)

    0 讨论(0)
  • 2021-01-27 07:13

    Can you publish the ppt as pps and use that file instead?

    0 讨论(0)
  • 2021-01-27 07:14

    Just export each slide as a JPG or PNG and display those: Slide.Export. This would be for static slide views. If you want to retain animations, transitions, video/audio and navigation features for your PPT/PPTX, a PowerPoint-to-Flash converter is a better way to do this. iSpring makes a free version of their converter: www.ispringfree.com.

    0 讨论(0)
  • 2021-01-27 07:17

    One solution could be to use something like Aspose.Slides to render the Slides to TIFF or PDF and then display those inside your application.

    0 讨论(0)
提交回复
热议问题