docx-rs/docx-core/examples/history.rs

20 lines
586 B
Rust
Raw Normal View History

2020-01-24 11:50:16 +02:00
use docx_core::*;
pub fn main() -> Result<(), DocxError> {
let path = std::path::Path::new("./history.docx");
let file = std::fs::File::create(&path).unwrap();
Docx::new()
.add_paragraph(
Paragraph::new()
.add_insert(
Insert::new(Run::new().add_text("Hello"))
.author("bokuweb")
.date("2019-01-01T00:00:00Z"),
)
.add_delete(Delete::new(Run::new().add_delete_text("World"))),
)
.build()
.pack(file)?;
Ok(())
}