Skip to content

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.

RustC#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
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");
C#TypeDetails
IsInMemoryboolKeep the document buffered in memory instead of on disk