Set the “Prompt for location at startup” User Preference from LotusScript

In Notes 5.x the selections made in the User Preferences dialog box (FilePreferencesUser Preferences) are stored in the notes.ini file as a decimal number in Preferences setting. This setting may be manipulated using binary operations if need be.

Please note: I would think that this is no way a Lotus supported way of doing this… 🙂

The “Prompt for location at startup” User Preferences is set using the 25th bit (1 000 000 000 000 000 000 000 000) which is 16777216 in decimal. Setting the flag can be accomplished using the binary OR operation.

Sub Initialize
   Dim session As New NotesSession
   Dim notes_ini_value As Long
   Dim notes_ini_value2 As Long
   notes_ini_value = Clng(session.GetEnvironmentString("Preferences", True))
   notes_ini_value2 = notes_ini_value Or 16777216
   Call session.SetEnvironmentVar("Preferences", Cstr(notes_ini_value2), True)
End Sub

If you need to toggle the flag you should use the XOR operation.