Skip to content

Latest commit

 

History

History
65 lines (45 loc) · 1.54 KB

Project.Application.UsableWidth.md

File metadata and controls

65 lines (45 loc) · 1.54 KB
title keywords f1_keywords ms.service api_name ms.assetid ms.date ms.localizationpriority
Application.UsableWidth property (Project)
vbapj.chm132778
vbapj.chm132778
project-server
Project.Application.UsableWidth
ccc312da-6794-657d-7c76-e3e8549e2da7
06/08/2017
medium

Application.UsableWidth property (Project)

Gets the maximum width available for a project window in points. Read-only Double.

Syntax

expression.UsableWidth

expression A variable that represents an Application object.

Remarks

The UsableWidth property equals the total amount of horizontal space inside the main window minus the space taken up by scroll bars.

Example

The following example moves the windows of every open project inside the main window.

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

[!includeSupport and feedback]