LoginSignup
1
1

More than 5 years have passed since last update.

Rubyのwin32oleを使ってPowerPointのシェイプのグループ化

Posted at

初めに

ページ数が多いPowerPointファイルの各ページでシェイプをグループ化する必要に迫られたので,やり方を調べた.

やり方

手っ取り早くサンプルコードを書く.PowerPointのファイルを開いて,その3枚目のスライド上の2番目と4番目のシェイプをグループ化するコードは以下.


require 'win32ole'

pp = WIN32OLE.new( 'PowerPoint.Application' )
pp.Visible = true

presen = pp.Presentations.Open :FileName => 'filepath'

presen.Slides(3).Shapes.Range(Array[2, 4]).Group
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1