Share via


Application オブジェクト

Microsoft PowerPoint Visual Basic リファレンス

Application オブジェクト

Application
複数のオブジェクト

PowerPoint アプリケーション全体を表します。Application オブジェクトには次のものが含まれています。

  • アプリケーション全般に適用される設定やオプション (利用可能なプリンタ名など)
  • ActivePresentationWindows などの、最上位レベルのオブジェクトを取得するプロパティ

使い方

Application オブジェクトを取得するには、Application プロパティを使用します。次の使用例は、アプリケーション ファイルのパスを取得します。

Dim MyPath As String
MyPath = Application.Path
		

次の使用例は、別のアプリケーションで PowerPoint Application オブジェクトを作成し、PowerPoint (まだ実行されていない場合) を起動し、"Ex_a2a.ppt" という名前の既存のプレゼンテーションを開きます。

Set ppt = New Powerpoint.Application
ppt.Visible = True
ppt.Presentations.Open "c:\My Documents\ex_a2a.ppt"
		

解説

PowerPoint から実行されるコードを記述する場合、次の Application オブジェクトのプロパティは、オブジェクト修飾語 ActivePresentationActiveWindowAddInsAssistantCommandBarsPresentationsSlideShowWindows、 および Windows を指定せずに使用できます。たとえば、Application.ActiveWindow.Height = 200 の代わりに ActiveWindow.Height = 200 と記述できます。