O'Reilly logo

Writing Word Macros, Second Edition by Steven Roman PhD

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Options Object

The Options object is used to set various Word options. It has a whopping 144 properties, but only one method: SetWPHelpOptions, which sets the options for the WordPerfect Help feature.

Here is an example of code that sets three Word options. Note that since the Options property is global, you can use it without qualification; that is, you can write Options rather than Application.Options:

	With Options
	    .AnimateScreenMovements = False 
	    .CheckSpellingAsYouType = False
	    .MeasurementUnit = wdPoints
	End With

The System Object

The System object contains information about the computer upon which the code is running. The System object has one very interesting method: MSInfo, which starts the Microsoft System Information application. This one you should try for yourself by entering the code:

	System.MSInfo

The properties of the System object:

Application

HorizontalResolution

PrivateProfileString

ComputerType

LanguageDesignation

ProcessorType

Connect

MacintoshName

ProfileString

Country

MathCoprocessorInstalled

QuickDrawInstalled

Creator

MSInfo

Version

Cursor

OperatingSystem

VerticalResolution

FreeDiskSpace

Parent

 

One of the most useful properties of the System object is PrivateProfileString, which provides a way to save and retrieve string data in a special type of text file, typically called an initialization file or INI file (with an .ini file extension), because it is used to store data that is used to initialize settings in an application. As you probably ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required