Word.InsertFileOptions interface
Specifies the options to determine what to copy when inserting a file.
Remarks
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/insert-external-document.yaml
// Inserts content (applying selected settings) from another document passed in as a Base64-encoded string.
await Word.run(async (context) => {
// Use the Base64-encoded string representation of the selected .docx file.
context.document.insertFileFromBase64(externalDocument, "Replace", {
importTheme: true,
importStyles: true,
importParagraphSpacing: true,
importPageColor: true,
importChangeTrackingMode: true,
importCustomProperties: true,
importCustomXmlParts: true,
importDifferentOddEvenPages: true
});
await context.sync();
});
Properties
import |
Represents whether the change tracking mode status from the source document should be imported. |
import |
Represents whether the custom properties from the source document should be imported. Overwrites existing properties with the same name. |
import |
Represents whether the custom XML parts from the source document should be imported. |
import |
Represents whether the page color and other background information from the source document should be imported. |
import |
Represents whether the paragraph spacing from the source document should be imported. |
import |
Represents whether the styles from the source document should be imported. |
import |
Represents whether the theme from the source document should be imported. |
Property Details
importChangeTrackingMode
Represents whether the change tracking mode status from the source document should be imported.
importChangeTrackingMode?: boolean;
Property Value
boolean
Remarks
importCustomProperties
Represents whether the custom properties from the source document should be imported. Overwrites existing properties with the same name.
importCustomProperties?: boolean;
Property Value
boolean
Remarks
importCustomXmlParts
Represents whether the custom XML parts from the source document should be imported.
importCustomXmlParts?: boolean;
Property Value
boolean
Remarks
importPageColor
Represents whether the page color and other background information from the source document should be imported.
importPageColor?: boolean;
Property Value
boolean
Remarks
importParagraphSpacing
Represents whether the paragraph spacing from the source document should be imported.
importParagraphSpacing?: boolean;
Property Value
boolean
Remarks
importStyles
Represents whether the styles from the source document should be imported.
importStyles?: boolean;
Property Value
boolean
Remarks
importTheme
Represents whether the theme from the source document should be imported.
importTheme?: boolean;
Property Value
boolean
Remarks
Office Add-ins