Word.RevisionType enum
指定修订类型。
注解
使用方
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/track-moved-text.yaml
// Reads and selects the text associated with a tracked move.
await Word.run(async (context) => {
const document: Word.Document = context.document;
const revisions: Word.RevisionCollection = document.revisions;
revisions.load("items/type");
await context.sync();
const movedFrom: Word.RevisionType = Word.RevisionType.movedFrom;
const movedTo: Word.RevisionType = Word.RevisionType.movedTo;
const movedRevision: Word.Revision | undefined = revisions.items.find(
(revision: Word.Revision) => revision.type === movedFrom || revision.type === movedTo
);
if (!movedRevision) {
console.log("Revision types found:", revisions.items.map((revision: Word.Revision) => revision.type));
console.warn("No tracked move was found. Move an entire paragraph as described in the task pane; moving a phrase may produce insertion and deletion revisions instead.");
return;
}
const movedRange: Word.Range = movedRevision.movedRange;
movedRange.load("text");
movedRange.select();
await context.sync();
console.log(`Moved revision range text: ${movedRange.text}`);
});
字段
| cellDeletion = "CellDeletion" | 单元格删除修订。 |
| cellInsertion = "CellInsertion" | 单元格插入修订。 |
| cellMerge = "CellMerge" | 单元格合并修订。 |
| cellSplit = "CellSplit" | 单元格拆分修订。 |
| conflict = "Conflict" | 冲突修订。 |
| conflictDelete = "ConflictDelete" | 冲突删除修订。 |
| conflictInsert = "ConflictInsert" | 冲突插入修订版本。 |
| delete = "Delete" | 删除修订. |
| displayField = "DisplayField" | 显示字段修订。 |
| insert = "Insert" | 插入修订。 |
| movedFrom = "MovedFrom" | 已从修订版移动。 |
| movedTo = "MovedTo" | 移至修订版本。 |
| none = "None" | 无修订。 |
| paragraphNumber = "ParagraphNumber" | 段落编号修订。 |
| paragraphProperty = "ParagraphProperty" | 段落属性修订。 |
| property = "Property" | 属性修订。 |
| reconcile = "Reconcile" | 协调修订。 |
| replace = "Replace" | 替换修订。 |
| sectionProperty = "SectionProperty" | 分区属性修订。 |
| style = "Style" | 样式修订。 |
| styleDefinition = "StyleDefinition" | 样式定义修订。 |
| tableProperty = "TableProperty" | 表属性修订。 |