GroupDocs.Annotation for .NET 让标注 Excel 电子表格变得轻松:
- 使用 Annotator 实例打开 Excel 文件。
- 创建并配置所需的批注。
- 将批注添加到电子表格中。
- 保存已标注的 Excel 文件。
GroupDocs.Annotation for .NET 让标注 Excel 电子表格变得轻松:
// 标注 Excel 电子表格
// 使用 Annotator 实例打开电子表格
using (Annotator annotator = new Annotator("input.xlsx"))
{
// 创建区域批注
AreaAnnotation area = new AreaAnnotation
{
Box = new Rectangle(100, 100, 200, 80),
BackgroundColor = 65535,
PageNumber = 0,
Message = "Important"
};
// 添加批注
annotator.Add(area);
// 保存已标注的电子表格
annotator.Save("annotated.xlsx");
}
向 Excel 电子表格添加所有批注类型,并使用简洁的 API 进行管理。

在 Excel 文件中突出显示、下划线、删除线或替换文本。
在 Excel 工作表上绘制形状并添加水印或图像。
获取、删除、导入和导出 Excel 批注。
// 打开已注释的电子表格
using (Annotator annotator = new Annotator("annotated.xlsx"))
{
// 获取所有注释
List<AnnotationBase> annotations = annotator.Get();
// 检查每个注释
foreach (AnnotationBase annotation in annotations)
{
System.Console.WriteLine(annotation.Message);
}
// 保存电子表格
annotator.Save("output.xlsx");
}