OfficeIMO

API Reference

Class

WordEmbeddedDocument

Namespace OfficeIMO.Word
Assembly OfficeIMO.Word

Represents an embedded document within a WordDocument.

Inheritance

Constructors

WordEmbeddedDocument 2 overloads
public WordEmbeddedDocument(WordDocument wordDocument, AltChunk altChunk) #

Initializes a new instance of the WordEmbeddedDocument class based on an existing AltChunk element.

Parameters

wordDocument OfficeIMO.Word.WordDocument requiredposition: 0
Parent WordDocument.
altChunk DocumentFormat.OpenXml.Wordprocessing.AltChunk requiredposition: 1
AltChunk that defines the embedded content.
public WordEmbeddedDocument(WordDocument wordDocument, String fileNameOrContent, Nullable<WordAlternativeFormatImportPartType> alternativeFormatImportPartType, Boolean htmlFragment) #

Initializes a new instance of the WordEmbeddedDocument class using the specified file or HTML fragment.

Parameters

wordDocument OfficeIMO.Word.WordDocument requiredposition: 0
Parent WordDocument.
fileNameOrContent System.String requiredposition: 1
File path or HTML content to embed.
alternativeFormatImportPartType System.Nullable{OfficeIMO.Word.WordAlternativeFormatImportPartType} requiredposition: 2
Explicit part type or null to infer from the file extension.
htmlFragment System.Boolean requiredposition: 3
When true, fileNameOrContent is treated as HTML markup rather than a file path.

Methods

public String GetHtml() #
Returns: String

Retrieves the HTML markup of the embedded document when available.

Returns

HTML content or null if the embedded document is not HTML.

public Void Remove() #
Returns: Void

Removes the embedded document from the parent WordDocument.

public Void Save(String fileName) #
Returns: Void

Saves the embedded document to the specified file.

Parameters

fileName System.String requiredposition: 0
Target file path.

Properties

public String ContentType { get; } #

Gets the content type of the embedded document.