We usually use PowerPoint presentations when we have a meeting or a summary report, and we can add comments on a single slide or on all the slides so that the audience can get more information from the comments, and the friends you need can refer to
We usually use PowerPoint presentations when we have a meeting or a summary report, and we can add comments on a single slide or on all the slides so that the audience can get more information from the comments.
Some friends do not know how to add comments in the slide, let me share with you how to add comments to the slides in C #.
Here I use a free control--free spire.presentation, interested friends can download using.
Namespaces that need to be added:
Using spire.presentation;using system.drawing;
Detailed steps and code snippets are as follows:
Step 1: Create a new Presentation object and load the presentation file from inside the system.
Presentation Presentation = new Presentation ();p resentation. LoadFromFile ("Sample.pptx");
Step 2: Call the Commentauthorlist.addauthor (author name, string initials) method to add the author comment.
Icommentauthor author = presentation.CommentAuthors.AddAuthor ("E-iceblue", "Comment:");
Step 3: Invoke call presentation. Slides[]. AddComment () method to add annotations to a particular slide. The class of comments contains a lot of information, such as the author of the comment, the time when the comment was added, the location where the comment was added, and the content of the comment.
Presentation. SLIDES[1]. AddComment (author, "This is pretty important. Attention to it ", New System.Drawing.PointF (4), DateTime.Now);
Step 4: Save and reopen the presentation presentation.
Presentation. SaveToFile ("Pptwithcomment.pptx", fileformat.pptx2010); System.Diagnostics.Process.Start ("Pptwithcomment.pptx");
:
All code:
using system;using system.collections.generic;using system.linq;using System.Text;using Spire.presentation; Namespace pptcomment{class Program {static void Main (string[] args) {//create PPT document and load file Presentation Presentation = new Presentation (); Presentation. LoadFromFile ("Sample.pptx"); Comment Author Icommentauthor author = presentation.CommentAuthors.AddAuthor ("E-iceblue", "Comment:"); Add comment presentation. SLIDES[1]. AddComment (author, "This is pretty important. Attention to it ", New System.Drawing.PointF (4), DateTime.Now); Save the document presentation. SaveToFile ("Pptwithcomment.pptx", fileformat.pptx2010); System.Diagnostics.Process.Start ("Pptwithcomment.pptx"); } }}