Presentationオブジェクト

Presentationオブジェクトは、1つのプレゼンテーション、つまりパワーポイントのファイル1つを指すと考えれば良いでしょう。

次のように、ActivePresentaionで現在開いているプレゼンテーションを取得することができます。

    Dim p As Presentation
    Set p = ActivePresentation

 

現在のプレゼンテーションの情報を得る

Public Sub PrintPresentationInfo()

    Dim p As Presentation
    Set p = ActivePresentation

    dp "FullName=", p.FullName
    dp "Name=", p.Name
    dp "Path=", p.Path
    dp "ReadOnly=", p.ReadOnly
    dp "Slides.Count=", p.Slides.Count
    dp "TemplateName=", p.TemplateName


'PrintPresentationInfo
'FullName=     C:\Users\さ\Desktop\IT\powerpoint\新規 Microsoft PowerPoint プレゼンテーション.pptm
'Name=         新規 Microsoft PowerPoint プレゼンテーション.pptm
'Path=         C:\Users\さ\Desktop\IT\powerpoint
'ReadOnly=     0
'Slides.Count= 43
'TemplateName= Office テーマ

End Sub

※ dpは「Debub.Print」のラッパーです。詳しくは、「このサイトで使用している共通関数のご紹介」をご覧ください

 

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です