Home > Domino Tips > Administrator > Desktop > Programmatically set "User Preferences" options
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DESKTOP

Programmatically set "User Preferences" options


Tom Panucci
10.10.2001
Rating: -4.37- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


You can set most user preference options by affecting a change to the "Preferences=" Notes.ini variable. This can be done without going through the Notes UI, that is, programatically. Only trick is what does that number mean? It means the following when converted to a 32 bit binary string (read from right to left):

Bit
0 <0> = Keep workspace in back when maximized (Enabled=1)
1 <2> = Scan for unread
2 <4> = <Unknown?>
3 <8> = Large fonts
4 <16> = <Unknown?>
5 <32> = Make Internet URLs (http//:) into hotspots
6 <64> = <Unknown?>
7 <128> = Typewriter fonts only
8 <256> = Monochrome display
9 <512> = Scandinavian collation
10 <1024> = <Unknown?>
11 <2048> = <see 28>
12 <4096> = Sign sent mail (Enabled(1))
13 <8192> = Encrypt sent mail
14 <16384> = Metric(1)/Imperial(0) measurements
15 <32768> = Numbers last collation
16 <65536> = French casing
17 <131072> = empty trash folder (prompt during db close=0/always during db close=1<plus "EmptyTrash=1" in INI>/manual=1<plus "EmptyTrash=2" in INI>
18 <262144> = Check for new mail every x minutes (Enabled=0)
19 <524288> = Enable local background indexing
20 <1048576> = Encrypt saved mail
21 <2097152> = <Unknown?>
22 <4194304> = <Unknown?>
23 <8388608> = Right double-click closes window
24 <16777216> = Prompt for location
25 <33554432> = <Unknown?>
26 <67108864> = Mark documents read when opened in the preview pane
27 <134217728> = Enable local scheduled agents
28 <268435456> = Save sent mail (Always prompt=10/Don't keep a copy=00/Always keep a copy=01)
29 <536870912> = <see 30>
30 <1073741824> = New mail notification (None=10/Audible=00/Visible=01)
31 <2147483648> = <Unknown? - there is no 31 in 4.6x...>

Table excerpted from a Notes.net posting



Code

Once you know what bits (options) you want to change, you can use LotusScript to make them.

Here is an example of how to alter JUST the "Save Sent Mail" Option (bits 11 & 28) without messing up any other user settings:

Sub Initialize

     Dim s As New NotesSession

     ' Set "Save sent mail" option  to "Always Prompt".  We need mail
server diskspace !!!
     Dim pref As Long
     Dim newpref As Long

     pref=s.GetEnvironmentValue( "Preferences" , True )
     prefbin$=Bin$(pref)  ' convert to a 32 bit binary string

       ' Set the two bit positions for "Save sent mail" option (11 & 28) to
"Always Prompt" (0 & 1)
     Mid$(prefbin$, 4, 1) = "1"     'bit pos 28  (32 minus 28)
     Mid$(prefbin$, 21, 1) = "0"   'bit pos 11 (32 minus 11)

     newpref="&B" & prefbin$ ' convert result back to a Long decimal number
     Call s.SetEnvironmentVar( "Preferences" , Cstr(newpref), True )

End Sub

Rate this Tip
To rate tips, you must be a member of SearchDomino.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Desktop
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Open a Lotus Notes database from Microsoft SharePoint 2007
Fix Lotus Notes 8.0 issues when launching Microsoft Office applications
Use a notes.ini setting to adjust font sizes in Lotus Notes
Quickly create a Notes/Domino event handler
Resetting a Lotus Notes password
Remove unnecessary bookmark icons
Toolbar tip to improve R6 performance
Managing ND6 client stability with Automatic Diagnostic Collection
Repair local databases on desktop

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts