Syntax
GetProfileString$([Section$,] KeyName$)
Remarks
In Windows 3.x, returns a setting in WIN.INI, or if Section$ is "Microsoft Word 2.0," "Microsoft Word," "MSWord Text Converters," or "MSWord Editable Sections," returns the setting from WINWORD6.INI instead. These exceptions are made for compatibility with Word for Windows version 2.x macros. On the Macintosh, GetProfileString$() returns settings from the Word Settings (6) file. In Windows or on the Macintosh, it is generally preferable to use GetPrivateProfileString$(), which allows you to specify a settings file from which to return information.
Argument | Explanation |
Section$ | The name of the section in the settings file that contains KeyName$. In Windows, the section name appears between brackets before the associated keys (do not include the brackets with Section$). If omitted, "Microsoft Word" is assumed. |
KeyName$ | The key whose setting you want to retrieve. In Windows, the key name is followed by an equal sign (=) and the setting. |
If a specified section or key does not exist, GetProfileString$() returns an empty string ("").
Note
In Windows 95 and Windows NT, settings are stored in the registry. You can still use SetProfileString and GetProfileString$() to set and return settings from a text file with the name WIN.INI, but neither the system nor Word uses these settings. To access and change values in the registry from within WordBasic, you need to use GetPrivateProfileString$() and SetPrivateProfileString$().
See Also
GetPrivateProfileString$(), SetPrivateProfileString, SetProfileString