Max Wanadoo
max.wanadoo at gmail.com
Sat Aug 15 05:33:35 CDT 2009
Stuart: I cannot find it right now, but I did come across this in some of my ancient code and it seems to work (slightly changed for sending here). There is also a GetAllSettings. I may be thinking of this. In which case, when do the Application Installation, set the Computer Name and then you can always check to see if it has changed each time you boot. I will continue looking, if I find it I will post it. Max Function xxxxx() 'GetSetting Function Example 'This example first uses the SaveSetting statement to make entries in the Windows registry '(or .ini file on 16-bit Windows platforms) for the application specified as appname, 'and then uses the GetSetting function to display one of the settings. 'Because the default argument is specified, some value is guaranteed to be returned. 'Note that section names can't be retrieved with GetSetting. Finally, the DeleteSetting statement 'removes all the application's entries. ' Variant to hold 2-dimensional array returned by GetSetting. Dim MySettings As Variant ' Place some settings in the registry. SaveSetting "Max's Application", "Startup", "Top", 75 SaveSetting "Max's Application", "Startup", "Left", 50 SaveSetting "Max's Application", "Platform", "ComputerName", Environ("Computername") '"Left", 50 Debug.Print GetSetting(appname:="Max's Application", Section:="Platform", key:="ComputerName", Default:="NotHeld") ' The registry will hold these settings. ' HKEY_USERS\S-1-5-21-2317311743-3275204689-2861515661-1000\Software\VB and VBA Program Settings\Max's Application\Platform ' HKEY_USERS\S-1-5-21-2317311743-3275204689-2861515661-1000\Software\VB and VBA Program Settings\Max's Application\Startup DeleteSetting "Max's Application", "Startup" DeleteSetting "Max's Application", "Platform" End Function