Sha256: 94416187049be604094c71def2af0b20e704d2a5277227c47cc3067e1e3a0453
Contents?: true
Size: 616 Bytes
Versions: 15
Compression:
Stored size: 616 Bytes
Contents
#!/usr/bin/env ruby # require "rails" # workaround: openxml-package uses `extract_options!` $:.push Dir.pwd + "/lib" require "openxml/docx" document = OpenXml::Docx::Package.new include OpenXml::Docx::Elements text = Text.new("Some text that I want to include in my new OOXML document") run = Run.new run << text paragraph = Paragraph.new paragraph << run document.document << paragraph filename = "rocx_test_base.docx" system "rm -f ~/Desktop/#{filename}" # -f so that we don't have an error if the file doesn't exist document.save File.expand_path("~/Desktop/#{filename}") exec "open ~/Desktop/#{filename}"
Version data entries
15 entries across 15 versions & 1 rubygems