aspose.cells
Class Comment

Encapsulates the object that represents a cell comment.

Example:

$workbook = new cells\Workbook();
$comments = $workbook->getWorksheets()->get(0)->getComments();

//Add comment to cell A1
$commentIndex = $comments->add(0, 0);
$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()
functionsetAuthor(value)
           Gets and sets Name of the original comment author
functiongetAutoSize()
functionsetAutoSize(value)
           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()
functionsetHeight(value)
           Represents the Height of the comment, in unit of pixels.
functiongetHeightCM()
functionsetHeightCM(value)
           Represents the height of the comment, in unit of centimeters.
functiongetHeightInch()
functionsetHeightInch(value)
           Represents the height of the comment, in unit of inches.
functiongetHtmlNote()
functionsetHtmlNote(value)
           Gets and sets the html string which contains data and some formats in this comment.
functionisVisible()
functionsetVisible(value)
           Represents if the comment is visible or not.
functiongetNote()
functionsetNote(value)
           Represents the content of comment.
functiongetRow()
           Gets the row index of the comment.
functiongetTextHorizontalAlignment()
functionsetTextHorizontalAlignment(value)
           Gets and sets the text horizontal alignment type of the comment. The value of the property is TextAlignmentType integer constant.
functiongetTextOrientationType()
functionsetTextOrientationType(value)
           Gets and sets the text orientation type of the comment. The value of the property is TextOrientationType integer constant.
functiongetTextVerticalAlignment()
functionsetTextVerticalAlignment(value)
           Gets and sets the text vertical alignment type of the comment. The value of the property is TextAlignmentType integer constant.
functiongetWidth()
functionsetWidth(value)
           Represents the width of the comment, in unit of pixels.
functiongetWidthCM()
functionsetWidthCM(value)
           Represents the width of the comment, in unit of centimeters.
functiongetWidthInch()
functionsetWidthInch(value)
           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

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.