Demonstration of Window size Properties : Application « Application « VBA / Excel / Access / Word

Home
VBA / Excel / Access / Word
1.Access
2.Application
3.Data Type
4.Data Type Functions
5.Date Functions
6.Excel
7.File Path
8.Forms
9.Language Basics
10.Math Functions
11.Outlook
12.PowerPoint
13.String Functions
14.Windows API
15.Word
16.XML
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
VBA / Excel / Access / Word » Application » Application 
Demonstration of Window size Properties
 
Sub GetWindowInfo() 
    Dim lState As Long 
    Dim sInfo As String 
    Dim lResponse As Long 

    ' Prepare message to be displayed 
    sInfo = sInfo & "Usable Height = " & Application.UsableHeight & vbCrLf 
    sInfo = sInfo & "Usable Width = " & Application.UsableWidth & vbCrLf 
    sInfo = sInfo & "Height = " & Application.Height & vbCrLf 
    sInfo = sInfo & "Width = " & Application.Width & vbCrLf & vbCrLf 

    lResponse = MsgBox(sInfo, vbYesNo, "Window Info"

    ' Minimize window if user clicked Yes 
    If lResponse = vbYes Then 
        Application.WindowState = xlMinimized 
    End If 
End Sub 

 
Related examples in the same category
1.Get application user name
2.Application.Path
3.Use the Application object qualifier to set properties
4.start word
5.start Power point
6.start mail client
7.start Access
8.start Foxpro
9.start Project
10.start schedule
11.Listing Application CommandBars
12.Make sure that the help file can be located:
13.Specifying the proper Excel version: Warn users who attempt to open the add-in using Excel 97
14.Pick the Perfect Location with GetSaveAsFilename
15.System Information Available Using Application Object Properties
16.CalculationVersion: Right four digits indicate the version of the calculation engine whereas the digits to the left indicate the major version of Excel.
17.MemoryFree Returns the amount of memory in bytes that Excel is allowed to use, not including memory already in use.
18.MemoryUsed Returns the amount of memory, in bytes, that Excel is currently using.
19.MemoryTotal Returns the total amount of memory, in bytes, that Excel can use. It includes memory that is already in use. It is the sum of MemoryFree and MemoryUsed.
20.OperatingSystem Returns the name and version of the Operating System.
21.OrganizationName Returns the name of the organization to which the product is registered.
22.UserName Returns or sets the name of the current user.
23.Version Returns the version of Excel that is in use.
24.Toggles the calculation mode between manual and automatic and displays a message indicating the current mode:
25.Turning off screen updating
26.Turning off automatic calculation: Sets the Excel calculation mode to manual
27.Execute the next statement to set the calculation mode to automatic:
28.To avoid these alert messages, insert the following VBA statement in your macro:
29.Clearing the Recently Used Files List
30.Setting a Default File Location
31.If you need to avoid user interaction you can turn off alerts in Excel by setting the DisplayAlerts property of the Application object to False before deleting the worksheet and then turning alerts back on again:
32.Quitting Application
33.Benchmark with/without setting the Application.ScreenUpdating
34.Application.InchesToPoints
35.Get window state information
36.Using the StatusBar property to Display Information
37.Cursors Available to Use with the Cursor Property
38.Performance Implications of Screen Updating
39.Display application in full screen mode
java2s.com  |  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.