This content is for v4.x version. Switch to the Stable version.
Word
The Word class/struct is the entry point for creating and opening Word (.docx) documents. In the current alpha the document engine supports creating a new blank document, opening an existing document and saving it back out. Rich content editing is in active development.
Methods
Section titled βMethodsβ| Rust | C# | Function |
|---|---|---|
Word::new(path, props) | new Word(props) / new Word(path, props) | Create a new document or open an existing file |
save_as(path) | SaveAs(path) | Save the document to a file |
Basic Code Samples
Section titled βBasic Code Samplesβuse draviavemal_openxml_office::document_2007::{Word, WordPropertiesModel};
// Create a new blank document (pass Some(path) to open an existing file)let file = Word::new(None, WordPropertiesModel::default()).expect("Blank File Open Failed");file.save_as("./output.docx").expect("Save Result Failed");using draviavemal.openxml_office.document_2007;
// Create a new blank documentWord word = new(new(){IsInMemory = false});word.SaveAs("./output.docx");
// Open an existing documentWord existing = new("basic_test.docx", new(){IsInMemory = false});existing.SaveAs("./edited.docx");Not yet available.
Not yet available.
Not yet available.
Not yet available.
WordProperties Options
Section titled βWordProperties Optionsβ| C# | Type | Details |
|---|---|---|
IsInMemory | bool | Keep the document buffered in memory instead of on disk |