Interface IComment
Represents the comment in the slide.
Namespace: Syncfusion.Presentation
Assembly: Syncfusion.Presentation.Base.dll
Syntax
public interface IComment
Properties
AuthorName
Gets or sets the author name of the comment
Declaration
string AuthorName { get; set; }
Property Value
Type |
---|
System.String |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Set the author name for the comment
slide.Comments[1].AuthorName = "Manager";
//Get the author name of the comment
string authorName = slide.Comments[1].AuthorName;
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
'Set the author name for the comment
slide.Comments(1).AuthorName = "Manager"
'Get the author name of the comment
Dim authorName As string = slide.Comments(1).AuthorName
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
DateTime
Gets or sets the created or modified date and time of the comment
Declaration
DateTime DateTime { get; set; }
Property Value
Type |
---|
System.DateTime |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Set the date and time of the comment
DateTime date = new DateTime(2017, 1, 18);
slide.Comments[1].DateTime = date ;
//Get the date and time of the comment
DateTime date1 = slide.Comments[1].DateTime;
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
'Set the date and time of the comment
Dim time As DateTime = New DateTime(2017, 1, 18)
slide.Comments(1).DateTime = time
'Get the date and time of the comment
Dim commentDatetime As DateTime = slide.Comments(1).DateTime
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
HasChild
Returns a boolean value that indicates the comment is a parent comment or a reply comment
Declaration
bool HasChild { get; }
Property Value
Type |
---|
System.Boolean |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Get the text of the the bool value that indicates whether a comment has reply or not
bool hasReply = slide.Comments[0].HasChild;
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
'Get the bool value that indicates whether a comment has reply or not
Dim hasReply As Boolean = slide.Comments(0).HasChild
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
Initials
Gets or sets the comment author initials
Declaration
string Initials { get; set; }
Property Value
Type |
---|
System.String |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Set the initial for the comment author.
slide.Comments[1].Initials = "M";
//Get the initial of the comment author
string authorInitial = slide.Comments[1].Initials;
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
'Set the initial for the comment author
slide.Comments(1).Initials = "M"
'Get the initial of the comment author
Dim authorInitial As string = slide.Comments(1).Initials
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
Left
Gets or sets the left position of the comment in slide
Declaration
double Left { get; set; }
Property Value
Type |
---|
System.Double |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Set the left position for the comment
slide.Comments[1].Left = 0.50;
//Get the left position of the comment
double leftPosition = slide.Comments[1].Left;
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
'Set the left position for the comment
slide.Comments(1).Left = 0.50
'Get the left position of the comment
Dim leftPosition As double = slide.Comments(1).Left
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
Parent
Returns the parent comment otherwise returns null if there is no parent comment
Declaration
IComment Parent { get; }
Property Value
Type | Description |
---|---|
IComment | Returns an IComment instance of parent comment |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Get the parent comment
IComment parentComment = slide.Comments[1].Parent;
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
'Get the parent comment
Dim parentComment As IComment = slide.Comments(1).Parent
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
Text
Gets or sets the comment text
Declaration
string Text { get; set; }
Property Value
Type |
---|
System.String |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Set the text of the comment
slide.Comments[1].Text = "How can i convert a slide to image or PDF?";
//Get the text of the comment
string commentText = slide.Comments[1].Text;
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
'Set the text of the comment
slide.Comments(1).Text = "How can i convert a slide to image or PDF?"
'Get the text of the comment
Dim commentText As string = slide.Comments(1).Text
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
Top
Gets or sets the top position of the comment in slide
Declaration
double Top { get; set; }
Property Value
Type |
---|
System.Double |
Examples
//Create a new presentation.
IPresentation presDoc = Presentation.Create();
//Add a blank slide to the presentation.
ISlide slide = presDoc.Slides.Add(SlideLayoutType.Blank);
//Add a text box to the slide
IShape shape = slide.Shapes.AddTextBox(100, 150, 300, 200);
//Add a paragraph to the textbody of the shape
shape.TextBody.AddParagraph("Hi Syncfusion Customers");
//Add a comment to the slide
IComment comment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now);
//Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment);
//Set the top position for the comment
slide.Comments[1].Top = 0.50;
//Get the top position of the comment
double topPosition = slide.Comments[1].Top;
//Save the presentation to the file system.
presDoc.Save("Output.pptx");
//Close the presentation
presDoc.Close();
Dim presDoc As IPresentation = Presentation.Create()
‘Add slide to the presentation
Dim slide As ISlide = presDoc.Slides.Add(SlideLayoutType.Blank)
‘Add table to the slide
Dim table As ITable = slide.Shapes.AddTable(2, 2, 100, 120, 300, 200)
'Add a text box to the slide
Dim shape As IShape = slide.Shapes.AddTextBox(100, 150, 300, 200)
'Add a paragraph to the text body of the shape
shape.TextBody.AddParagraph()
'Add a comment to the slide
Dim comment As IComment = slide.Comments.Add(0.35, 0.04, "Author1", "A1", "Essential Presentation is available from 13.1 versions of Essential Studio", DateTime.Now)
'Author2 add reply to a parent comment
slide.Comments.Add("Author2", "A2", "Does it support rendering of slides as images or PDF?", DateTime.Now, comment)
'Set the top position for the comment
slide.Comments(1).Top = 0.50
'Get the top position of the comment
Dim topPosition As double = slide.Comments(1).Top
‘Save the presentation
presDoc.Save("Sample.pptx")
‘Close the presentation
presDoc.Close()
Methods
GetChild()
Declaration
List<IComment> GetChild()
Returns
Type |
---|
System.Collections.Generic.List<IComment> |