Share via


Window オブジェクト (Project)

アプリケーションまたはプロジェクト内のウィンドウを表します。 Window オブジェクトは Windows コレクションのメンバーです。

注釈

注:

[!メモ] Windows コレクションは、以前のバージョンとの互換性を保持するために用意されています。 新しく開発する場合には、 Windows2 コレクションを使用することをお勧めします。

Application.Windows コレクションには、アプリケーションのすべてのウィンドウが含まれています。 Project.Windows コレクションには、指定されたプロジェクトのウィンドウだけが含まれています。

Window オブジェクトの使い方

1 つの Window オブジェクトを返すには、Windows (Index) を使用します。Index はウィンドウインデックス番号またはウィンドウ キャプションです。 次の使用例は、ウィンドウの一覧の 1 番目のウィンドウを最大化します。

Application.Windows(1).WindowState = pjMaximized

The window caption is the text shown in the title bar at the top of the window when the window is not maximized. The caption is also shown in the list of open files on the bottom of the Windows menu. Use the Caption property to set or return the window caption. Changing the window caption does not change the name of the project. The following example hides the window that contains the caption "Project1".

If Application.Windows(1).Caption = "Project1" Then
    Application.Windows(1).Visible = False
End If

Windows コレクションの使い方

Windows コレクションを取得するには、Windows プロパティを使用します。 次の使用例は、Project で現在表示されているすべてのウィンドウを少しずつ重ねて表示します。

With Application.Windows
    For I = 1 To .Count
        .Item(I).Activate
        .Item(I).Top = (I - 1) * 15
        .Item(I).Left = (I - 1) * 15
    Next I
End With

Use the WindowNewWindow method to create a new window and add it to the collection. The following example creates a new window for the active project.

Application.WindowNewWindow

メソッド

名前
Activate
Close
Refresh
WebBrowserControlFrame
WebBrowserControlWindow

プロパティ

名前
ActivePane
アプリケーション
BottomPane
Caption
Height
インデックス
Left
Parent
Top
TopPane
Visible
Width
WindowState

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。