Comment

更新时间:2023-01-09 11:16:35

本文介绍与演示文稿Comment相关的API。

Comments

ActivePresentation.Slides.Comments

获取演示文稿中的所有评论。

重要
  • JS-SDK V1.1.14及以上版本支持此功能。

  • PC端支持此功能。

  • 语法

    表达式.ActivePresentation.Slides.Comments

    表达式:文档类型应用对象

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
      
      //获取演示文稿中的所有评论
      await app.ActivePresentation.Slides.Comments;
    }

方法

ActivePresentation.Slides.Comments.Add()

通过Add()方法,您可以新增评论。

重要
  • JS-SDK V1.1.14及以上版本支持此功能。

  • PC端支持此功能。

  • 语法

    表达式.ActivePresentation.Slides.Comments.Add({ SlideId, Text, Replyer })

    表达式:文档类型应用对象

  • 参数

    属性

    数据类型

    是否必填

    描述

    属性

    数据类型

    是否必填

    描述

    SlideId

    Number

    幻灯片ID。

    Text

    String

    评论文本。

    Replyer

    Object

    评论信息体。

    Replyer说明

    属性

    数据类型

    是否必填

    描述

    属性

    数据类型

    是否必填

    描述

    AuthorName

    String

    作者名称。

    AuthorId

    String

    作者ID。

    CommentId

    String

    评论ID。

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      //获取第一个评论
      let item1 = await app.ActivePresentation.SlideShowWindow.View.Slide.Comments.Item(1);
      let SlideId = await item1.SlideId;
      let Text = '这是一条新评论';
      let Author = await item1.Author;
      let AuthorId = await item1.AuthorId;
      let CommentId = await item1.CommentId;
    
      //新增评论
      await app.ActivePresentation.SlideShowWindow.View.Slide.Comments.Add({
        SlideId,
        Text,
        Replyer: {
          Author,
          AuthorId,
          CommentId,
        },
      });
    }

ActivePresentation.Slides.Comments.GoToCommentItem()

通过GoToCommentItem()方法,您可以跳转到指定评论位置。

重要
  • JS-SDK V1.1.14及以上版本支持此功能。

  • PC端支持此功能。

  • 语法

    表达式.ActivePresentation.Slides.Comments.GoToCommentItem({ SlideId, CommentId })

    表达式:文档类型应用对象

  • 参数

    属性

    数据类型

    是否必填

    描述

    属性

    数据类型

    是否必填

    描述

    SlideId

    Number

    幻灯片ID。

    CommentId

    String

    评论ID。

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      //获取第一个评论
      let item1 = await app.ActivePresentation.SlideShowWindow.View.Slide.Comments.Item(1);
      let SlideId = await item1.SlideId;
      let CommentId = await item1.CommentId;
    
      //跳转到指定评论的位置
      await app.ActivePresentation.SlideShowWindow.View.Slide.Comments.GoToCommentItem({ SlideId, CommentId });
    }

属性

ActivePresentation.Slides.Comments.Count

通过Count属性,您可以获取评论总数。

重要
  • JS-SDK V1.1.14及以上版本支持此功能。

  • PC端支持此功能。

  • 语法

    表达式.ActivePresentation.Slides.Comments.Count

    表达式:文档类型应用对象

  • shil

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      //获取评论总数
      const count = await app.ActivePresentation.SlideShowWindow.View.Slide.Comments.Count;
      console.log(count);
    }

Comment

ActivePresentation.Slides.Comments.Item()

获取单个评论对象。

重要
  • JS-SDK V1.1.14及以上版本支持此功能。

  • PC端支持此功能。

  • 语法

    表达式.ActivePresentation.Slides.Comments.Item(Index)

    表达式:文档类型应用对象

  • 参数

    属性

    数据类型

    是否必填

    描述

    属性

    数据类型

    是否必填

    描述

    Index

    Number

    Index个评论。

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      //获取第一个评论
      let item1 = await app.ActivePresentation.SlideShowWindow.View.Slide.Comments.Item(1);
      console.log(item1);
    }

属性

ActivePresentation.Slides.Comments.Item(Index).Author

通过Author属性,您可以获取指定评论的作者。

重要
  • JS-SDK V1.1.14及以上版本支持此功能。

  • PC端支持此功能。

  • 语法

    表达式.ActivePresentation.Slides.Comments.Item(Index).Author

    表达式:文档类型应用对象

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      //获取第一个评论的作者
      let Author = await app.ActivePresentation.SlideShowWindow.View.Slide.Comments.Item(1).Author;
    
      console.log(Author);
    }

ActivePresentation.Slides.Comments.Item(Index).AuthorId

通过AuthorId属性,您可以获取指定评论的作者ID。

重要
  • JS-SDK V1.1.14及以上版本支持此功能。

  • PC端支持此功能。

  • 语法

    表达式.ActivePresentation.Slides.Comments.Item(Index).AuthorId

    表达式:文档类型应用对象

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      //获取第一个评论的作者ID
      let AuthorId = await app.ActivePresentation.SlideShowWindow.View.Slide.Comments.Item(1).AuthorId;
    
    
      console.log(AuthorId);
    }

ActivePresentation.Slides.Comments.Item(Index).CommentId

通过CommentId属性,您可以获取指定评论的评论ID。

重要
  • JS-SDK V1.1.14及以上版本支持此功能。

  • PC端支持此功能。

  • 语法

    表达式.ActivePresentation.Slides.Comments.Item(Index).CommentId

    表达式:文档类型应用对象

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      //获取第一个评论的评论ID
      let CommentId = await app.ActivePresentation.SlideShowWindow.View.Slide.Comments.Item(1).CommentId;
    
    
      console.log(CommentId);
    }

ActivePresentation.Slides.Comments.Item(Index).DateTime

通过DateTime属性,您可以获取指定评论的时间戳。

重要
  • JS-SDK V1.1.14及以上版本支持此功能。

  • PC端支持此功能。

  • 语法

    表达式.ActivePresentation.Slides.Comments.Item(Index).DateTime

    表达式:文档类型应用对象

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      //获取第一个评论的时间戳
      let DateTime = await app.ActivePresentation.SlideShowWindow.View.Slide.Comments.Item(1).DateTime;
    
    
      console.log(DateTime);
    }

ActivePresentation.Slides.Comments.Item(Index).Replies

通过Replies属性,您可以获取指定评论的回复列表。

重要
  • JS-SDK V1.1.14及以上版本支持此功能。

  • PC端支持此功能。

  • 语法

    表达式.ActivePresentation.Slides.Comments.Item(Index).Replies

    表达式:文档类型应用对象

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      //获取第一个评论的回复列表
      let Replies = await app.ActivePresentation.SlideShowWindow.View.Slide.Comments.Item(1).Replies;
    
    
      console.log(Replies);
    }

ActivePresentation.Slides.Comments.Item(Index).SlideId

通过SlideId属性,您可以获取指定评论所在的幻灯片ID。

重要
  • JS-SDK V1.1.14及以上版本支持此功能。

  • PC端支持此功能。

  • 语法

    表达式.ActivePresentation.Slides.Comments.Item(Index).SlideId

    表达式:文档类型应用对象

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      //获取第一个评论所在的幻灯片ID
      let SlideId = await app.ActivePresentation.SlideShowWindow.View.Slide.Comments.Item(1).SlideId;
    
    
      console.log(SlideId);
    }

ActivePresentation.Slides.Comments.Item(Index).Text

通过Text属性,您可以获取指定评论的评论文本。

重要
  • JS-SDK V1.1.14及以上版本支持此功能。

  • PC端支持此功能。

  • 语法

    表达式.ActivePresentation.Slides.Comments.Item(Index).Text

    表达式:文档类型应用对象

  • 示例

    async function example() {
      await instance.ready();
    
      const app = instance.Application;
    
      //获取第一个评论的评论文本
      let Text = await app.ActivePresentation.SlideShowWindow.View.Slide.Comments.Item(1).Text;
    
    
      console.log(Text);
    }
  • 本页导读 (1)
  • Comments
  • ActivePresentation.Slides.Comments
  • 方法
  • 属性
  • Comment
  • 属性