Enum PrintCommentsType

PrintCommentsType enumeration

Represents the way comments are printed with the sheet.

public enum PrintCommentsType

Values

NameValueDescription
PrintInPlace0Represents to print comments as displayed on sheet.
PrintNoComments1Represents not to print comments.
PrintSheetEnd2Represents to print comments at end of sheet.
PrintWithThreadedComments3Represents to print comments as displayed on sheet include threaded comments.

Examples

[C#]

namespace Demos
{
    using Aspose.Cells;
    using System;

    public class PrintCommentsTypeDemo
    {
        public static void PrintCommentsTypeExample()
        {
            // Create a new workbook
            Workbook workbook = new Workbook();
            Worksheet worksheet = workbook.Worksheets[0];

            // Add some comments to the worksheet
            int commentIndex = worksheet.Comments.Add("A1");
            Comment comment = worksheet.Comments[commentIndex];
            comment.Note = "This is a comment.";

            commentIndex = worksheet.Comments.Add("B2");
            comment = worksheet.Comments[commentIndex];
            comment.Note = "This is another comment.";

            // Set the print comments type in the page setup
            PageSetup pageSetup = worksheet.PageSetup;
            pageSetup.PrintComments = PrintCommentsType.PrintSheetEnd;

            // Save the workbook to a file
            workbook.Save("PrintCommentsTypeExample.xlsx");

            Console.WriteLine("Workbook saved successfully with comments printed at the end of the sheet.");
        }
    }
}

See Also