Solved

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

Posted on 2002-04-02
4
180 Views
Last Modified: 2008-01-16
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
0
Comment
Question by:jerahteo
  • 2
4 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 60 total points
Comment Utility
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
Comment Utility
Upgrading to notes 5.x could do your life easy.
;)
0
 

Author Comment

by:jerahteo
Comment Utility
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
 

Author Comment

by:jerahteo
Comment Utility
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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now