Word.ParagraphChangedEventArgs interface

提供有关引发 paragraphChanged 事件的段落的信息。

注解

[ API 集:WordApi 1.6 ]

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/25-paragraph/onchanged-event.yaml

// Registers the onParagraphChanged event handler on the document.
await Word.run(async (context) => {
  eventContext = context.document.onParagraphChanged.add(paragraphChanged);
  await context.sync();

  console.log("Added event handler for when content is changed in paragraphs.");
});

...

async function paragraphChanged(event: Word.ParagraphChangedEventArgs) {
  await Word.run(async (context) => {
    console.log(`${event.type} event detected. IDs of paragraphs where content was changed:`, event.uniqueLocalIds);
  });
}

属性

source

事件的源。 通过共同创作) ,它可以是本地或远程 (。

type

事件类型。 请参阅Word。EventType 了解详细信息。

uniqueLocalIds

获取所涉及的段落的唯一 ID。 ID 采用标准 8-4-4-4-4-12 GUID 格式,没有大括号,并且因会话和共同创作而异。

属性详细信息

source

事件的源。 通过共同创作) ,它可以是本地或远程 (。

source: Word.EventSource | "Local" | "Remote";

属性值

Word.EventSource | "Local" | "Remote"

注解

[ API 集:WordApi 1.6 ]

type

事件类型。 请参阅Word。EventType 了解详细信息。

type: Word.EventType | "ContentControlDeleted" | "ContentControlSelectionChanged" | "ContentControlDataChanged" | "ContentControlAdded" | "CommentDeleted" | "CommentSelected" | "CommentDeselected" | "CommentChanged" | "CommentAdded" | "ContentControlEntered" | "ContentControlExited" | "ParagraphAdded" | "ParagraphChanged" | "ParagraphDeleted" | "AnnotationClicked" | "AnnotationHovered" | "AnnotationInserted" | "AnnotationRemoved" | "AnnotationPopupAction";

属性值

Word.EventType | "ContentControlDeleted" | "ContentControlSelectionChanged" | "ContentControlDataChanged" | "ContentControlAdded" | "CommentDeleted" | "CommentSelected" | "CommentDeselected" | "CommentChanged" | "CommentAdded" | "ContentControlEntered" | "ContentControlExited" | "ParagraphAdded" | "ParagraphChanged" | "ParagraphDeleted" | "AnnotationClicked" | "AnnotationHovered" | "AnnotationInserted" | "AnnotationRemoved" | "AnnotationPopupAction"

注解

[ API 集:WordApi 1.6 ]

uniqueLocalIds

获取所涉及的段落的唯一 ID。 ID 采用标准 8-4-4-4-4-12 GUID 格式,没有大括号,并且因会话和共同创作而异。

uniqueLocalIds: string[];

属性值

string[]

注解

[ API 集:WordApi 1.6 ]