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

Version Path
openxml-docx-0.11.5 examples/base
openxml-docx-0.11.4 examples/base
openxml-docx-0.11.3 examples/base
openxml-docx-0.11.2 examples/base
openxml-docx-0.11.1 examples/base
openxml-docx-0.11.0 examples/base
openxml-docx-0.11.0.rc examples/base
openxml-docx-0.10.6 examples/base
openxml-docx-0.10.5 examples/base
openxml-docx-0.10.4 examples/base
openxml-docx-0.10.3 examples/base
openxml-docx-0.10.2 examples/base
openxml-docx-0.10.1 examples/base
openxml-docx-0.10.0 examples/base
openxml-docx-0.9.0 examples/base