API Reference
Class
WordEmbeddedDocument
Represents an embedded document within a WordDocument.
Inheritance
- WordElement
- WordEmbeddedDocument
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
- Parent WordDocument.
- altChunk DocumentFormat.OpenXml.Wordprocessing.AltChunk
- 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
- Parent WordDocument.
- fileNameOrContent System.String
- File path or HTML content to embed.
- alternativeFormatImportPartType System.Nullable{OfficeIMO.Word.WordAlternativeFormatImportPartType}
- Explicit part type or null to infer from the file extension.
- htmlFragment System.Boolean
- When true, fileNameOrContent is treated as HTML markup rather than a file path.
Methods
public String GetHtml() #Returns:
StringRetrieves the HTML markup of the embedded document when available.
Returns
HTML content or null if the embedded document is not HTML.
public Void Save(String fileName) #Returns:
VoidSaves the embedded document to the specified file.
Parameters
- fileName System.String
- Target file path.
Inherited Methods
public override Boolean Equals(Object obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object
Properties
public String ContentType { get; } #Gets the content type of the embedded document.