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

20 lines
593 B
Rust
Raw Permalink Normal View History

use docx_rs::*;
2020-01-24 11:50:16 +02:00
pub fn main() -> Result<(), DocxError> {
let path = std::path::Path::new("./history.docx");
let file = std::fs::File::create(path).unwrap();
2020-01-24 11:50:16 +02:00
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().add_run(Run::new().add_delete_text("World"))),
2020-01-24 11:50:16 +02:00
)
.build()
.pack(file)?;
Ok(())
}