Skip to content

Commit

Permalink
[Word] (insert external doc) Check for platform-specific reqt. set (#955
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ElizabethSamuel-MSFT authored Dec 16, 2024
1 parent b685b04 commit 49f4ca0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions samples/word/50-document/insert-external-document.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ script:
const externalDoc: Word.DocumentCreated = context.application.createDocument(externalDocument);
await context.sync();
if (!Office.context.requirements.isSetSupported("WordApiHiddenDocument", "1.3")) {
console.warn("The WordApiHiddenDocument 1.3 requirement set isn't supported on this client so can't proceed. Try this action on a platform that supports this requirement set.");
return;
}
const externalDocBody: Word.Body = externalDoc.body;
externalDocBody.load("text");
await context.sync();
Expand Down
15 changes: 15 additions & 0 deletions snippet-extractor-output/snippets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15926,6 +15926,11 @@
const externalDoc: Word.DocumentCreated = context.application.createDocument(externalDocument);
await context.sync();

if (!Office.context.requirements.isSetSupported("WordApiHiddenDocument", "1.3")) {
console.warn("The WordApiHiddenDocument 1.3 requirement set isn't supported on this client so can't proceed. Try this action on a platform that supports this requirement set.");
return;
}

const externalDocBody: Word.Body = externalDoc.body;
externalDocBody.load("text");
await context.sync();
Expand All @@ -15950,6 +15955,11 @@
const externalDoc: Word.DocumentCreated = context.application.createDocument(externalDocument);
await context.sync();

if (!Office.context.requirements.isSetSupported("WordApiHiddenDocument", "1.3")) {
console.warn("The WordApiHiddenDocument 1.3 requirement set isn't supported on this client so can't proceed. Try this action on a platform that supports this requirement set.");
return;
}

const externalDocBody: Word.Body = externalDoc.body;
externalDocBody.load("text");
await context.sync();
Expand Down Expand Up @@ -20430,6 +20440,11 @@
const externalDoc: Word.DocumentCreated = context.application.createDocument(externalDocument);
await context.sync();

if (!Office.context.requirements.isSetSupported("WordApiHiddenDocument", "1.3")) {
console.warn("The WordApiHiddenDocument 1.3 requirement set isn't supported on this client so can't proceed. Try this action on a platform that supports this requirement set.");
return;
}

const externalDocBody: Word.Body = externalDoc.body;
externalDocBody.load("text");
await context.sync();
Expand Down

0 comments on commit 49f4ca0

Please sign in to comment.