blah blah

Automating Powerpoint with ruby

크롬에서 첫번째 써보는 글.
Automating Powerpoint with ruby 에 소개된 루비로 파워포인트 다루는 예제 소스를 살짝 수정해보았다. 

require ‘win32ole’

ppt_file = ARGV[0]
exp_file = ppt_file.sub(/\.ppt$/i, ”)
# open powerpoint
ppt =‘Powerpoint.Application’)
# make sure it is visible
ppt.Visible = true
# open the presentation to be exported
pre = ppt.Presentations.Open(ppt_file)
# export the file
(1..pre.Slides.count).each do |i|
     pre.Slides(i).Export(“#{exp_file}_#{i}.png”, “png”)
# close powerpoint, will close all the currently open files

Ruby + Powerpoint 관련해서는 아래 블로그도 볼만하다.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s