Partager via


Propriété Application.UsableHeight (Project)

Obtient la hauteur maximale disponible pour une fenêtre du projet en points. Double (en lecture seule).

Syntaxe

expression. UsableHeight

expressionUne variable qui représente un objetApplication.

Remarques

La propriété UsableHeight correspond à l’espace vertical total à l’intérieur de la fenêtre principale, duquel est déduit l’espace occupé par le ruban, les barres d’état, les barres de défilement et la barre de titre.

Exemple

L’exemple suivant montre comment déplacer à l’intérieur de la fenêtre principale les fenêtres des projets ouverts.

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

Assistance et commentaires

Avez-vous des questions ou des commentaires sur Office VBA ou sur cette documentation ? Consultez la rubrique concernant l’assistance pour Office VBA et l’envoi de commentaires afin d’obtenir des instructions pour recevoir une assistance et envoyer vos commentaires.