For the complete experience, please enable JavaScript in your browser. Thank you!

  • Creative Cloud
  • Photoshop
  • Illustrator
  • InDesign
  • Premiere Pro
  • After Effects
  • Lightroom
  • See all
  • See plans for: businesses photographers students
  • Document Cloud
  • Acrobat DC
  • eSign
  • Stock
  • Elements
  • Marketing Cloud
  • Analytics
  • Audience Manager
  • Campaign
  • Experience Manager
  • Media Optimizer
  • Target
  • See all
  • Acrobat Reader DC
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player
  • All products
  • Creative Cloud
  • Individuals
  • Photographers
  • Students and Teachers
  • Business
  • Schools and Universities
  • Marketing Cloud
  • Document Cloud
  • Stock
  • Elements
  • All products
  • Get Support
    Find answers quickly. Contact us if you need to.
    Start now >
  • Learn the apps
    Get started or learn new ways to work.
    Learn now >
  • Ask the community
    Post questions and get answers from experts.
    Start now >
    • About Us
    • Careers At Adobe
    • Investor Relations
    • Privacy  |  Security
    • Corporate Responsibility
    • Customer Showcase
    • Events
    • Contact Us
News
    • 3/22/2016
      Adobe Summit 2016: Are You An Experience Business?
    • 3/22/2016
      Adobe Announces Cross-Device Co-op to Enable People-Based Marketing
    • 3/22/2016
      Adobe and comScore Advance Digital TV and Ad Measurement
    • 3/22/2016
      Adobe Marketing Cloud Redefines TV Experience
CFML Reference / 

SpreadsheetSetCellComment

Adobe Community Help


Applies to

  • ColdFusion

Contact support

 
By clicking Submit, you accept the Adobe Terms of Use.
 

Description

Specifies the comment for an Excel spreadsheet object cell.

Returns

Does not return a value.

Category

Microsoft Office Integration

Function syntax

SpreadsheetSetCellComment(spreadsheetObj, comment, row, column)

See also

SpreadsheetGetCellComment, SpreadsheetFormatCell, SpreadsheetGetCellFormula, SpreadsheetGetCellValue, 

SpreadsheetMergeCells, SpreadsheetSetCellFormula, SpreadsheetSetCellValue

History

ColdFusion 9: Added the function.

Parameters

Parameter

Description

spreadsheetObj

The Excel spreadsheet object to which to add the comment.

comment

A structure containing the comment including text, formatting, and placement in the cell. See Usage for the structure contents.

row

The row number of the cell to which to add the comment.

column

The column number of the cell to which to add the comment.

Usage

The comment structure can have the following fields. Excel determines the default field values.

Field

Valid values

anchor

A comma separated list of integers specifying the position and size of the comment, in rows and columns, in the order top column, left row,bottom column, right row. For example: "4,8,6,11" specifies a comment with an upper left corner in row 4 column 8 and a lower right corner in row 6 column 11.

author

The author's name.

bold

A Boolean value specifying whether the text is bold.

color

The text color, Any value in the Apache org.apache.poi.hssf.util.HSSFColor class:black, brown, olive_green, dark_green, dark_teal, dark_blue, indigo, grey_80_percent, orange, dark_yellow, green, teal, blue, blue_grey, grey_50_percent, red, light_orange, lime, sea_green, aqua, light_blue, violet, grey_40_percent, pink, gold, yellow, bright_green, turquoise, dark_red, sky_blue, plum, grey_25_percent, rose, light_yellow, light_green, light_turquoise, light_turquoise, pale_blue, lavender, white, cornflower_blue, lemon_chiffon, maroon, orchid, coral, royal_blue, light_cornflower_blue.

comment

A string containing the comment text.

fillcolor

A J2SE v1.4 java.awt.Color class color value: white, lightGray, light_gray, gray, darkGray, dark_gray, black, red, pink, orange, yellow, green, magenta, cyan, blue. (Because ColdFusion is case independent, you do not need to specify the values if defined in the Java class.)

font

Any valid system font name.

horizontalalignment

The horizontal alignment of the text: left, center, right, justify, distributed.

italic

A Boolean value specifying whether the text is italic.

linestyle

The style of the top and right borders of the comment box: solid, dashsys, dotsys, dashdotsys, dashdotdotsys, dotgel, dashgel, longdashgel, dashdotgel, longdashdotgel, longdashdotdotgel.

linestylecolor

A Java color value (Does not work: BUG 72501).

size

The size of the text in points.

strikeout

A Boolean value specifying whether the text is struck out.

underline

A Boolean value specifying whether the text is underlined.

verticalalignment

The vertical alignment of the text: top, center, bottom, justify, distributed.

visible

A Boolean value specifying whether the text is visible.

Example

The following example sets and gets a comment for the cell at row 3column 5.

<cfscript>
///We need an absolute path, so get the current directory path.
theFile=GetDirectoryFromPath(GetCurrentTemplatePath()) & "comment.xls";
//Create an Excel spreadsheet object.
theSheet = SpreadsheetNew();
// Define a cell comment.

comment1-structNew()
comment1.anchor="0,0,5,8";
comment1.author="Adobe Systems";
comment1.bold="true";
comment1.color="dark_green";
comment1.comment="This is the cell in row three, column 5 (E).";
comment1.fillcolor="light_gray";
comment1.font="Courier";
comment1.horizontalalignment="left";
comment1.linestyle="dashsys";
comment1.size="10";
comment1.verticalalignment="top";

//Set the comment.
SpreadsheetSetCellComment(theSheet,comment1,3,5);
//Get the comment from the Excel spreadsheet object.
theComment=SpreadsheetGetCellComment(theSheet,3,5);
</cfscript>

<cfoutput>
Row,Column: #theComment.row#,#theComment.column#<br />
Author: #theComment.author#<br />
Comment: #theComment.comment#
</cfoutput>

<!--- Write the spreadsheet to a file, replacing any existing file. --->
<cfspreadsheet action="write" filename="#theFile#" name="theSheet"
sheet=1 sheetname="courses" overwrite=true>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy

Choose your region United States (Change)   Products   Downloads   Learn & Support   Company
Choose your region Close

Americas

Europe, Middle East and Africa

Asia Pacific

  • Brasil
  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Cyprus - English
  • Česká republika
  • Danmark
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Greece - English
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • Malta - English
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • Southeast Asia (Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam) - English
  • 台灣

Commonwealth of Independent States

  • Includes Armenia, Azerbaijan, Belarus, Georgia, Moldova, Kazakhstan, Kyrgyzstan, Tajikistan, Turkmenistan, Ukraine, Uzbekistan

Copyright © 2016 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy | Cookies

AdChoices