Editing Powerpoint Slide in C# Windows Form
I'm trying to develop a Point of Purchase sign creator. The best way that I can think of going about this is using a powerpoint slide to create the POP.
The problem that I'm having with this is I can find pages after pages of information to open up a presentation, but I can't seem to find anything that'll let me open the actual powerpoint file for editing. The client will not need to make new textboxes or anything of that sort, but will need to be able to edit them.
开发者_如何学GoCurrently I'm using a web browser to view the ppt presentation but as I mentioned, it is merely a presentation.
private void Form1_Load(object sender, EventArgs e)
{
this.webBrowser1.Navigate("about.blank");
string path = "C:\\Users\\Test\\test.ppt";
this.webBrowser1.Navigate(path);
}
Thank you in advance
p.s. I do have Office Interop referenced in the project but it seems that everything is so situationally specific that I cannot find much information to help me out.
It would be good if you could provide a little more info on exactly how flexible the editing needs to be, and what version of PowerPoint you are targeting. From your question and approach you appear to be looking for access to all of the capabilities. This is not something that you are going to be able to do easily with your approach.
A few other options which might work for you:
- Use the Open XML format and generate the PPT from an external data source. This seems a lot cleaner to me but you have less flexibility than your current approach. You would need to capture user's changes yourself and then generate the file to preview.
- Copy a PPT file to a temp file and open it in PowerPoint for editing. Then allow the user to edit and update it. When they close the temp file capture it and bring them back to your main application. The user has full access to the PPT file to do what they want but you have a lot of edge cases to handle. eg. what if they close the file and don't exit PowerPoint etc.
- Write a PowerPoint add-in that works with your application, and make some Ribbon customisations. The user will get the full PowerPoint experience but there will be custom support for your application on the Ribbon and the user can just click to have the finished PPT sent back to your application. This seems like it would be more maintainable than option 2 since you are probably going to use more standard APIs and a user has to click your "finish" button to complete the process meaning that you have a clearly defined end point instead of watching for user behaviour that you could miss.
精彩评论