Determin the notes Directory in Formula or script

I have an issue. Thoughout our company we have Lotus Notes installed in 5 different spots. I want to create an agent which can determin where the directory is housed. I know the information is in the notes.ini file, but I’m having issues trying to display it.

Right now I just want to display a prompt to advise where their notes is installed (i.e. C:\Lotus\notes\data)…

This is what I was trying:

Dim nsess As NotesSession

Dim strNoteID As String

Dim varTmp As Variant

Set nsess = New NotesSession

varTmp = nsess.GetEnvironmentString(“Directory”)

Msgbox "Your Directory is: " & varTemp, , “Directory”

It’s not displaying anything.

I’m more familar with Formulas, but have read that in Formula it cannot be done. So I resort to Lotusscript, which I’m still very new at.

Any suggestions would be a great help!

Thanks

Subject: Determin the notes Directory in Formula or script

Hi Edmound,

if you look in your notes.ini file, you’ll notice that some variables in there are preceded with a ‘$’. These are ‘non-system’ variables that have been set/can be accessed with the @Environment function. Any other variables cannot be accessed with formula language. But in LS, they can be accessed if you specify an optional parameter to the method you used of ‘True’. The default without the parameter is False. So, in your case, the line should read:

nsess.GetEnvironmentString(“Directory”, True)

This should give you what you need.

hth

Tony

Subject: RE: Determin the notes Directory in Formula or script

Thanks for the info…I tried it but it didn’t display anything. All I’m getting is a blank message box:

Dim nsess As NotesSession

Dim varTmp As String

Set nsess = New NotesSession

varTmp = nsess.GetEnvironmentString(“Directory”, True)

Msgbox "Your Directory is: " & varTemp, , “Directory”

Any thoughts?

Thanks

Subject: RE: Determin the notes Directory in Formula or script

Hi Edmound,

sorry for the delay in replying.

The problem is in your code. Check for the value of varTmp not varTemp!

We’ve all done it, and that’s why Lotus added the ability to automatically add ‘Option Declare’ to all new code, which would have stopped you doing what you did. Including this in the Options section will force you to declare any variables that you use in your code. You set it by right-clicking the programmers pane while in agent, selecting ‘Programmers Pane Proprties’, then on the second tab, selecting ‘Automatically add “Option Declare”’.

hth

Tony