GetSystemInfo, GetSystemInfo$()

Syntax

GetSystemInfo Array$()

GetSystemInfo$(Type)

Remarks

The GetSystemInfo statement fills a previously defined string array with information about the environment in which Word is running. In Windows, the size of the array should be 12 elements; on the Macintosh, 15 elements.

The GetSystemInfo$() function returns one piece of information about the environment in which Word is running. Type is one of the following numeric codes, specifying the type of information to return. In Windows, Type is a value from 21 to 32. Note that Type 23, 25, and 27 return meaningful values in Windows 3.x only.

Type

Explanation

21

The environment (for example, "Windows" or "Windows NT")

22

The type of central processing unit, or CPU (for example, "80286," "80386," "i486," or "Unknown")

23

The MS-DOS version number

24

The Windows version number

25

The percent of system resources available

26

The amount of available disk space, in bytes

27

The mode under which Windows is running: "Standard" or "386-Enhanced"

28

Whether a math coprocessor is installed: "Yes" or "No"

29

The country setting

30

The language setting

31

The vertical display resolution, in pixels

32

The horizontal display resolution, in pixels


On the Macintosh, Type is a value from 512 to 526.

Type

Explanation

512

The environment ("Macintosh")

513

The folder for storing settings files (for example, "HD:System Folder:Preferences:")

514

Whether the current display is color: "Yes" or "No"

515

The processor type (for example, "68000", "68040", or "PowerPC™")

516

The computer type (for example, "Macintosh IIci" or "PowerBook™ 145")

517

System software version (for example, "7.1")

518

The Macintosh name as set in the Sharing Setup control panel

519

Whether QuickDraw GX is installed: "Yes" or "No"

520

Whether Balloon Help™ is on: "Yes" or "No"

521

The vertical display resolution, in pixels

522

The horizontal display resolution, in pixels

523

The country setting

524

Whether a math coprocessor is installed: "Yes" or "No"


Type

Explanation

525

Total memory available for running applications, in bytes

526

Free disk space, in bytes


If you are writing a macro to run both in Windows and on the Macintosh, use the AppInfo$() function to determine the current platform before running a GetSystemInfo$() instruction.

Examples

This Windows example creates a table of system information in a new document. First, the example defines and fills an array with labels for each type of system information. Second, the example opens a new document and defines the info$() array, which GetSystemInfo then fills with the system information. Finally, the For¼Next loop inserts the table of information. This example could be easily modified for the Macintosh by increasing the size of the array to 14 and changing the labels.


Dim a$(11)
a$(0) = "Environment" : a$(1) = "CPU" : a$(2) = "MS-DOS"
a$(3) = "Windows" : a$(4) = "% Resources" : a$(5) = "Disk Space"
a$(6) = "Mode" : a$(7) = "Coprocessor" : a$(8) = "Country"
a$(9) = "Language" : a$(10) = "Pixels High" : a$(11) = "Pixels Wide"
Dim info$(11)
GetSystemInfo info$()
FileNewDefault
FormatTabs .Position = "1.5 in", .Set
For i = 0 To 11
    Insert a$(i) + Chr$(9) + info$(i)
    InsertPara
Next

The following Macintosh example displays in a message box the total amount of available disk space:


space$ = GetSystemInfo$(526)
MsgBox "Available disk space: " + space$ + " bytes."

See Also

AppInfo$()