Word.InsertFileOptions interface

Specifies the options to determine what to copy when inserting a file.

Remarks

[ API set: WordApi 1.5 ]

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

importChangeTrackingMode

Represents whether the change tracking mode status from the source document should be imported.

importCustomProperties

Represents whether the custom properties from the source document should be imported. Overwrites existing properties with the same name.

importCustomXmlParts

Represents whether the custom XML parts from the source document should be imported.

importDifferentOddEvenPages

Represents whether to import the Different Odd and Even Pages setting for the header and footer from the source document.

importPageColor

Represents whether the page color and other background information from the source document should be imported.

importParagraphSpacing

Represents whether the paragraph spacing from the source document should be imported.

importStyles

Represents whether the styles from the source document should be imported.

importTheme

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

[ API set: WordApi 1.5 ]

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

[ API set: WordApi 1.6 ]

importCustomXmlParts

Represents whether the custom XML parts from the source document should be imported.

importCustomXmlParts?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi 1.6 ]

importDifferentOddEvenPages

Represents whether to import the Different Odd and Even Pages setting for the header and footer from the source document.

importDifferentOddEvenPages?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi 1.7 ]

importPageColor

Represents whether the page color and other background information from the source document should be imported.

importPageColor?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi 1.5 ]

importParagraphSpacing

Represents whether the paragraph spacing from the source document should be imported.

importParagraphSpacing?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi 1.5 ]

importStyles

Represents whether the styles from the source document should be imported.

importStyles?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi 1.5 ]

importTheme

Represents whether the theme from the source document should be imported.

importTheme?: boolean;

Property Value

boolean

Remarks

[ API set: WordApi 1.5 ]