Overcome Lotus ID Switching/Send Mail Using Specific ID/Identify Specific Office

I had write a work flow program using VB. When a new enquiry been raised,program will send a mail to action party involved.

Problem - When Visual Basic Application program is sending out mail, Lotus Notes when not started will be started automatically with the Login windows activated. My program can send the login password by using sendkey method. However if someone else had previously login with and account then when my program try to create a session it will result in error. As the current login account is no longer the same as the one I specify in my program. This result in an error.

If the Lotus is already running, how do I specify a specify ID account to used so that the mail send out will carry the ID name I designate.

Lastly how do I used VB to control the office Location.

Wrong office location also cause error to my program
jerahteoAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
TimCotteeConnect With a Mentor Head of Software ServicesCommented:
You should read the Notes.ini file in c:\lotus\notes folder. If you read this file in line by line, and then make the appropriate changes to the following entries:

KeyFilename=User.id
MailServer=MAILSERVER
MailFile=mail\user.nsf

Before notes is launched it will then take these values when it is started.

Something like this:

Name c:\lotus\notes\notes.ini c:\lotus\notes\notes.old
Open "Notes.old" for input As #1
Open "Notes.ini" for output as #2
Do
  Line Input #1,strLine
  aryParts = Split(strLine,"=")
  If aryParts(0) = "KeyFilename" Then
    aryParts(1) = "MyNewUser.id"
  End If
  If aryParts(0) = "MailServer" Then
    aryParts(1) = "MyMailServer"
  End If
  If aryParts(0) = "MailFile" Then
    aryParts(1) = "mail\MyNewUser.nsf"
  End If
  strLine = Join(aryParts,"=")
  Print #2,strLine
Loop Until Eof(1)
Close #1
Close #2

Will create a new copy of notes.ini with the appropriate values.
0
 
Richie_SimonettiIT OperationsCommented:
Upgrading to notes 5.x could do your life easy.
;)
0
 
jerahteoAuthor Commented:
Thanks TimCotte but I have some question that I wish to clearify with you regarding your comment to me.

You mention that I should change the following :

KeyFilename=User.id
MailServer=MAILSERVER
MailFile=mail\user.nsf

But in a share Lotus Notes the account will always be changing. Beside changing the above what about
- CertificateExpChecked
- Location

I notice Location do following the ID switching it will always remain as what it had been set to till another user change the location again. How can I arrest this changes, will I be able to set to a default location.

As for CertificateExpChecked I saw this changes when I switch to my own ID :
CertificateExpChecked=C:\teoyh121.id 03-04-2002
I conclude that the CertificateExpChecked will also change along with the ID switch. Will your script mentioned take care of this.

Pardon me but I am not a expert in Lotus there I was wondering the script which you post is it mend to be inserted direct into Notes.ini or it has to be create somewhere else, please advice. Refering to script below.

Name c:\lotus\notes\notes.ini c:\lotus\notes\notes.old
Open "Notes.old" for input As #1
Open "Notes.ini" for output as #2
Do
 Line Input #1,strLine
 aryParts = Split(strLine,"=")
 If aryParts(0) = "KeyFilename" Then
   aryParts(1) = "MyNewUser.id"
 End If
 If aryParts(0) = "MailServer" Then
   aryParts(1) = "MyMailServer"
 End If
 If aryParts(0) = "MailFile" Then
   aryParts(1) = "mail\MyNewUser.nsf"
 End If
 strLine = Join(aryParts,"=")
 Print #2,strLine
Loop Until Eof(1)
Close #1
Close #2

0
 
jerahteoAuthor Commented:
Thanks TimCottee I have try out your comment and it did work changing the login ID to a default ID I want. I had also added the Location and Certificate part as well.

Sub SetDefaultID()

Open "C:\Lotus\Notes\Notes.old" For Input As #1
Open "C:\Lotus\Notes\Notes.ini" For Output As #2

Do While Not EOF(1)
 If EOF(1) = True Then Exit Sub
 Line Input #1, strLine
 
 aryParts = Split(strLine, "=")
 If aryParts(0) = "KeyFilename" Then
   aryParts(1) = "C:\tdept122.id"
 End If
 
 If aryParts(0) = "MailServer" Then
   aryParts(1) = "CN=STNMC002"
 End If
 
 If aryParts(0) = "MailFile" Then
   aryParts(1) = "\mailgp001\tdept122.nsf"
 End If
 
 If aryParts(0) = "CertificateExpChecked" Then
 aryParts(1) = "C:\tdept122.id " & Date
 End If
 
 If aryParts(0) = "Location" Then
 aryParts(1) = "Office (TSD),9A2,CN=TECH Service Dept/OU=TSD/OU=ST Marine/O=ST Group"
 End If
 
 strLine = Join(aryParts, "=")
 Print #2, strLine
Loop

Close #1
Close #2

End Sub

Initially I did not notice that the script you given me is a VB script however I came to realise it later.

But there is a problem with the script. When It loop to the eof it did not break out of the loop and it went into an error out of range. This is a small matter anyway.

The above will address the problem when the Lotus Notes is not running, but if its already login with another user account how then can I used VB to change the User ID so that the outgoing mail which I send from VB will contain my name or email address instead of another account name or email address.

Look forward to your comment.

Many thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.