20 lines
586 B
Rust
20 lines
586 B
Rust
|
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(())
|
||
|
}
|