Application.UsableWidth プロパティ (Project)

プロジェクト ウィンドウで使用できる最大幅をポイント単位で取得します。 読み取り専用の Double です。

構文

UsableWidth

expressionApplication オブジェクトを 表す変数。

注釈

UsableWidth プロパティは、ウィンドウのスクロール バーによって占有スペースを引いたサイズの水平方向のスペースの合計量に相当します。

次の使用例は、開かれているすべてのプロジェクトの大きさや位置を、アプリケーション ウィンドウ内に収まるように調整します。

Sub FitWindows() 
 
 Dim W As Window ' The Window object used in For Each loop 
 
 For Each W In Application.Windows 
 ' Adjust the height of each window, if necessary. 
 If W.Height > UsableHeight Then 
 W.Height = UsableHeight 
 W.Top = 0 
 ' Adjust the vertical position of each window, if necessary. 
 ElseIf W.Top + W.Height > UsableHeight Then 
 W.Top = UsableHeight - W.Height 
 End If 
 
 ' Adjust the width of each window, if necessary. 
 If W.Width > UsableWidth Then 
 W.Width = UsableWidth 
 W.Left = 0 
 ' Adjust the horizontal position of each window, if necessary. 
 ElseIf W.Left + W.Width > UsableWidth Then 
 W.Left = UsableWidth - W.Width 
 End If 
 Next W 
 
End Sub

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

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