HiI have notes.ini and I want to insert user mail server and mailFile, let say after line 5 .How I can do that. This notes.ini is not the one in user workstation, it is on temp directory, I will change it and then attach it in rich text field.
other thing if I am using the notesstream class in server agent it will support, I read this class just work in workstation, please confirm this.
GetFile =“C:\Baseline\notes.ini”
Dim stream As NotesStream
Set stream = session.CreateStream
If Not stream.Open(GetFile, “ASCII”) Then
Messagebox GetFile, “Open failed”
Exit Sub
End If
Call stream.WriteText(“MailFile=” + doc.CnabMailFile(0), EOL_CRLF)
Call stream.WriteText(“MailServer=” +doc.CnabMailServer(0), EOL_NONE )
Call stream.Close
Thanks
Subject: why do you do this?
up to three repost within 3 days. without changing a single line - that’s not to best way to get answers…
3.Mar.05 NotesStream Class and insert text between the lines in notes.ini??
2.Mar.05 NotesStream AND insert text between the lines??
6.Dec.04 In a Mail template wAddress form customize to get the department name and Entrylist get user name ??? but (2nd Post)
5.Dec.04 Mail template wAddress form customize to get the department name and from department get the user name ??? but
3.Dec.04 @DbCommand(“Domino”; “LoadAddressListByName”…) and customizing wAddress (2nd Post)
2.Dec.04 @DbCommand(“Domino”; “LoadAddressListByName”…) and customizing wAddress
1.Dec.04 @DbCommand(“Domino”; “LoadAddressListByName”…) and customizing wAddress
Subject: RE: why do you do this?
Hi Markuswell, after the post I wait for answer, and it seem to me after one day old no one read the post so I key in again.
But some time it seem to me either question is not clear enough to give the answer or …
Thanks
Subject: RE: why do you do this?
Hi SebastianThe notes.ini is not the one from user machine, actually this is generic one for each user and I want to make changes in notes.ini for each user and attach it to each user document.
I am already appending at the end of notes.ini but i want to add between lines.
Thanks
Subject: NotesStream Class and insert text between the lines in notes.ini??
HiWhy do you want to put the information at a specified line?
Thats not necessary to read the notes.ini-Entries.
The formula “@Environment” and the LotusScript function “getEnvironmentString” search the full file.
Try to append the entries at the end of file.
Somehow like that:
Dim fileNum As Integer
Dim fileName As String
fileNum% = FreeFile()
fileName$ = “c:\temp\notes.ini”
Open fileName$ For Append As fileNum%
Write #fileNum%, “MailServer=CN=Server/OU=ABCD/O=DEF/C=US”
#fileNum%, “mail\user.nsf”
Close fileNum%
After a look in my own notes.ini I found both entries (Mail Server + Mail File).
I hope that’s help.
Subject: From the help for NotesStream.WriteText…
UsageThis method appends the text to the end of the stream.
This method raises an error if the stream is read-only. See IsReadOnly.
When a stream is written, property values are:
Bytes is incremented by the number of bytes read
IsEOS is True
Position is set at end of stream
If the stream is opened on an empty file and the character set is Unicode, UTF-16, UTF-16BE, or UTF-16LE, this method writes byte order mark or signature bytes at the beginning of the stream. These bytes are transparent upon subsequent accesses of the stream with the same character set.
So, accorcding to the help, you can only write to the END of the stream. To write to the middle of the file, you would have to use 2 streams. Read in from the first 5 lines and write them to the second. Then write your 2 Lines. Then continue reading from the first stream and writing to the second until EOS.
Subject: RE: From the help for NotesStream.WriteText…
but how you read first five line and write to output. How I can say this is first line and this is 2nd so on.
Thnaks
Subject: NotesStream.ReadText can read one line of text from the file.
so:For i = 1 to 4
OneLine = NotesStream1.ReadText(STMREAD_LINE, EOL_ANY)
bcount = NotesStream2.WriteText(OneLine, EOL_PLATFORM)
Next
NotesStream2.WriteText(YourInsertLine1, EOL_PLATFORM)
NotesStream2.WriteText(YourInsertLine2, EOL_PLATFORM)
bcount = NotesStream2.WriteText(NotesStream1.ReadText())
Subject: RE: NotesStream.ReadText can read one line of text from the file.
Thank BillToday I will try and let you know.
Thaks again.
Lisa