Class XlsxComments
- Namespace
- DocWright.Spreadsheet
- Assembly
- DocWright.Spreadsheet.dll
The notes of one sheet of an opened workbook (Phase 200): read as the file lists them, added, changed and removed as Excel's New Note, Edit Note and Delete Note do, and written the way Excel writes its own.
public sealed class XlsxComments : IReadOnlyList<XlsxComment>, IReadOnlyCollection<XlsxComment>, IEnumerable<XlsxComment>, IEnumerable
- Inheritance
-
XlsxComments
- Implements
- Inherited Members
Remarks
Measured with Excel 16 (tools/Probe-ExcelComments.ps1): a note is a comment
in the sheet's comments part and a shape in its legacy drawing (VML); Excel refuses a
workbook with a note that has no shape, or whose shape names another cell, and one with a
note on a range, a note outside the grid, two notes on one cell or an author the list does
not have. It loses a note when the list is not in row order, so a note added here goes where
the order puts it. A new note's box is 108 by 59.25 points, beside the cell, as Excel places
one (see XlsxComment).
Edits are held in memory and written into the parts when anything next reads them (an insert, a sort, a copy) or the workbook is saved: adding a note to every row of a long sheet costs one write of each part. Inserting and deleting rows and columns moves notes and their boxes.
Properties
- Count
Gets the number of notes.
- this[int]
Gets a note by its place in the list.
Methods
- Add(int, int, string, string?)
Adds a note to a cell, as Excel's New Note does.
- Add(string, string, string?)
Adds a note to a cell, as Excel's New Note does. See Add(int, int, string, string?).
- Find(int, int)
Returns the note on a cell, or null when it has none.
- Find(string)
Returns the note on a cell, or null when it has none.
- GetEnumerator()
Returns the notes, in the order the file lists them.
- Remove(XlsxCellRange)
Removes the notes of a range, as Excel's Delete Note does over a selection: every note on a cell in the range. Threaded comments stay.
- Remove(XlsxComment)
Removes one note.