//
you're reading...
Domino

New Mail Pop Up

Have you ever been developing an app where you are trying to close the Notes client programatically and the client use’s the New Mail Popup? Well, thanks to some recent code I implemented for a customer, we can effectively toggle this on and off. Here is the code..

Dim s As New NotesSession
Dim prefIn As String, prefOut As String, zeros32 As String
Dim prefOrig As Long, prefNew As Long

prefOrig = s.GetEnvironmentString( “Preferences”, True )
zeros32 = “00000000000000000000000000000000”
prefIn = Bin$(prefOrig)
prefIn = Left$(zeros32,32-Len(prefIn)) & prefIn
Print “Original Pref: num= bin=”

‘ To Turn Pop Up On

If Mid$(prefIn,3,1) = “1” Then
prefNew = prefOrig And &B11011111111111111111111111111111
Print “Updated Pref: num= bin=”
prefOut = prefNew
Call s.SetEnvironmentVar(“Preferences”,prefOut,True)
End If

‘ To Turn Pop Up Off

If Mid$(prefIn,3,1) = “0” Then
prefNew = prefOrig Or &B00100000000000000000000000000000
Print “Updated Pref: num= bin=”
prefOut = prefNew
Call s.SetEnvironmentVar(“Preferences”,prefOut,True)
End If

This will basically turn the preferences= line of the Notes.ini into a binary value. The 30th bit (of 32) will identify the flag for those popups. 1 means the bit is on, and 0 means the bit is off. This way, you can check the Notes.ini to turn it off, if need be, and then turn it back to the original after your processing.

Advertisements

About pwhiltz

I am a Domino Administrator and Developer who has been working with IBM Domino solutions since 1997. I work for an Enterprise Email Migration company and am delving into the realm of Microsoft Exchange now.

Discussion

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: