Share via


ProfileString Property

Returns or sets a value for an entry in the Windows registry under the following subkey: HKEY_CURRENT_USER\Software\Microsoft\Office\version\Word. Read/write String.

expression**.ProfileString**(Section, Key)

expression Required. An expression that returns a System object.

Section    Required String. A subkey below the "HKEY_CURRENT_USER\Software\Microsoft\Office\version\Word" subkey in the Windows registry.

Key    Required String. The name of the entry in the subkey specified by Section (for example, "BackgroundPrint" in the Options subkey).

Example

This example retrieves and displays the startup path stored in the Windows registry.

MsgBox System.ProfileString("Options", "STARTUP-PATH")

This example sets and returns the value for an entry in the Windows registry (the SubkeyName subkey is added below HKEY_CURRENT_USER\Software\Microsoft\Office\version\Word).

System.ProfileString("SubkeyName", "EntryName") = "Value"
MsgBox System.ProfileString("SubkeyName", "EntryName")

Applies to | System Object

See Also | PrivateProfileString Property