aspose.cells

Class Comment

Encapsulates the object that represents a cell comment.

Example:

var workbook = new aspose.cells.Workbook();
var comments = workbook.getWorksheets().get(0).getComments();

//Add comment to cell A1
var commentIndex = comments.add(0, 0);
var comment = comments.get(commentIndex);
comment.setNote("First note.");
comment.getFont().setName("Times New Roman");

//Add comment to cell B2
comments.add("B2");
comment = comments.get("B2");
comment.setNote("Second note.");

Property Getters/Setters Summary
functiongetAuthor()
function
setAuthor(value)
           Gets and sets Name of the original comment author
functiongetAutoSize()
function
           Indicates if size of comment is adjusted automatically according to its content.
functiongetColumn()
Gets the column index of the comment.
functiongetCommentShape()
Get a Shape object that represents the shape attached to the specified comment.
functiongetFont()
Gets the font of comment.
functiongetHeight()
function
setHeight(value)
           Represents the Height of the comment, in unit of pixels.
functiongetHeightCM()
function
           Represents the height of the comment, in unit of centimeters.
functiongetHeightInch()
function
           Represents the height of the comment, in unit of inches.
functiongetHtmlNote()
function
           Gets and sets the html string which contains data and some formats in this comment.
functionisVisible()
function
setVisible(value)
           Represents if the comment is visible or not.
functiongetNote()
function
setNote(value)
           Represents the content of comment.
functiongetRow()
Gets the row index of the comment.
functiongetTextHorizontalAlignment()
function
           Gets and sets the text horizontal alignment type of the comment. The value of the property is TextAlignmentType integer constant.
functiongetTextOrientationType()
function
           Gets and sets the text orientation type of the comment. The value of the property is TextOrientationType integer constant.
functiongetTextVerticalAlignment()
function
           Gets and sets the text vertical alignment type of the comment. The value of the property is TextAlignmentType integer constant.
functiongetWidth()
function
setWidth(value)
           Represents the width of the comment, in unit of pixels.
functiongetWidthCM()
function
setWidthCM(value)
           Represents the width of the comment, in unit of centimeters.
functiongetWidthInch()
function
           Represents the width of the comment, in unit of inches.
 
Method Summary
functioncharacters(startIndex, length)
Returns a Characters object that represents a range of characters within the comment text.
functionformatCharacters(startIndex, length, font, flag)
Format some chararcters with the font setting.
functiongetCharacters()
Returns all Characters objects that represents a range of characters within the comment text.
 

    • Property Getters/Setters Detail

      • getAuthor/setAuthor : String 

        function getAuthor() / function setAuthor(value)
        
        Gets and sets Name of the original comment author
      • getCommentShape : CommentShape 

        function getCommentShape()
        
        Get a Shape object that represents the shape attached to the specified comment.
      • getRow : Number 

        function getRow()
        
        Gets the row index of the comment.
      • getColumn : Number 

        function getColumn()
        
        Gets the column index of the comment.
      • getNote/setNote : String 

        function getNote() / function setNote(value)
        
        Represents the content of comment.
      • getHtmlNote/setHtmlNote : String 

        function getHtmlNote() / function setHtmlNote(value)
        
        Gets and sets the html string which contains data and some formats in this comment.
      • getFont : Font 

        function getFont()
        
        Gets the font of comment.
      • isVisible/setVisible : boolean 

        function isVisible() / function setVisible(value)
        
        Represents if the comment is visible or not.
      • getTextOrientationType/setTextOrientationType : Number 

        function getTextOrientationType() / function setTextOrientationType(value)
        
        Gets and sets the text orientation type of the comment. The value of the property is TextOrientationType integer constant.
      • getTextHorizontalAlignment/setTextHorizontalAlignment : Number 

        function getTextHorizontalAlignment() / function setTextHorizontalAlignment(value)
        
        Gets and sets the text horizontal alignment type of the comment. The value of the property is TextAlignmentType integer constant.
      • getTextVerticalAlignment/setTextVerticalAlignment : Number 

        function getTextVerticalAlignment() / function setTextVerticalAlignment(value)
        
        Gets and sets the text vertical alignment type of the comment. The value of the property is TextAlignmentType integer constant.
      • getAutoSize/setAutoSize : boolean 

        function getAutoSize() / function setAutoSize(value)
        
        Indicates if size of comment is adjusted automatically according to its content.
      • getHeightCM/setHeightCM : Number 

        function getHeightCM() / function setHeightCM(value)
        
        Represents the height of the comment, in unit of centimeters.
      • getWidthCM/setWidthCM : Number 

        function getWidthCM() / function setWidthCM(value)
        
        Represents the width of the comment, in unit of centimeters.
      • getWidth/setWidth : Number 

        function getWidth() / function setWidth(value)
        
        Represents the width of the comment, in unit of pixels.
      • getHeight/setHeight : Number 

        function getHeight() / function setHeight(value)
        
        Represents the Height of the comment, in unit of pixels.
      • getWidthInch/setWidthInch : Number 

        function getWidthInch() / function setWidthInch(value)
        
        Represents the width of the comment, in unit of inches.
      • getHeightInch/setHeightInch : Number 

        function getHeightInch() / function setHeightInch(value)
        
        Represents the height of the comment, in unit of inches.
    • Method Detail

      • formatCharacters

        function formatCharacters(startIndex, length, font, flag)
        Format some chararcters with the font setting.
        Parameters:
        startIndex: Number - The start index.
        length: Number - The the length.
        font: Font - The font setting.
        flag: StyleFlag - The flag of the font setting.
      • characters

        function characters(startIndex, length)
        Returns a Characters object that represents a range of characters within the comment text.
        Parameters:
        startIndex: Number - The index of the start of the character.
        length: Number - The number of characters.
        Returns:
        Characters object.
      • getCharacters

        function getCharacters()
        Returns all Characters objects that represents a range of characters within the comment text.
        Returns:
        All Characters objects