Method: WPS::Word#givedoc
- Defined in:
- lib/word_handler/wpsword.rb
#givedoc(name = nil, fpath = nil) ⇒ Object
创建doc文档
参数:
name 给doc取个名字
fpath doc文档的绝对路径
28 29 30 31 32 33 34 35 36 |
# File 'lib/word_handler/wpsword.rb', line 28 def givedoc(name = nil, fpath = nil) unless FileTest::exist?(fpath) doc = @exe.Documents.Add() doc.Activate doc.SaveAs("#{fpath}", 0) end doc = @exe.Documents.Open("#{fpath}") ; @@doclist["#{name}"] = doc end |