MファイルスクリプトによるPPTファイルのスライドのコピー&ペースト
    9 visualizaciones (últimos 30 días)
  
       Mostrar comentarios más antiguos
    
    Hirokazu Masugami
 el 5 de Jun. de 2018
  
    
    
    
    
    Respondida: Hirokazu Masugami
 el 11 de Jun. de 2018
            Mファイルスクリプトを使ってPPTファイルを編集する際に、 スライドをコピー&ペーストするにはどうすればいいでしょうか?
イメージとしては まず、テンプレートとして使いたいPPTファイル(タイトルページとコンテンツページによる2ページ構成) を開き、 コンテンツページをコピー&ペーストして、その中に情報を埋め込み、 最後におそらく残ってしまうであろう空のコンテンツページ(ページコピーのコピー元用)を削除して、 PPTを保存するようなことをしたいと考えています。
0 comentarios
Respuesta aceptada
  Takashi Ueno
    
 el 8 de Jun. de 2018
        MATLABでpptファイルを操作する場合、actxserverによってPowerPointのオートメーションサーバーを使用し、PowerPoint オブジェクトを操作することになります。
一例ですが、カレントディレクトリ上の'original.pptx'の2番目のスライドをコピーし、新規作成したスライドに挿入し、カレントディレクトリに'new.pptx'として保存する場合、以下のように行えます。
PowerPointのオブジェクトモデルを使用しているため、コマンドの詳細については、マイクロソフト社のリファレンス等をご参照ください。
% ActiveX オブジェクトを作成 
ppt = actxserver('powerpoint.application'); 
ppt.Visible = 1; 
% 新しいプレゼンテーションの作成 
ppt_new=ppt.Presentations.Add(); 
% 新しいプレゼンテーションの0番目のスライドの後ろ(つまり1番目のスライド)に、 
% 元のプレゼンテーションのi番目からj番目までのスライドをコピー 
% 今回は2番目のスライドをコピー 
ppt_new.Slides.InsertFromFile([pwd,'\original.pptx'],0,2,2); 
% 保存 
ppt_new.SaveAs([pwd,'\new.pptx']) 
% 終了 
ppt.Quit 
ppt.delete
0 comentarios
Más respuestas (1)
Comunidades de usuarios
Más respuestas en Power Electronics Control
Ver también
Categorías
				Más información sobre Deep Learning Toolbox en Help Center y File Exchange.
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
