Saturday, December 31, 2011

Creating a new text file using LotusScript


There is a excellent way to create a new file of our own in any type using LotusScript.


Eg: We can create any type of file just by changing the extension of the file name.
Here is the sample code to create a file using lotusScript.

Dim ses As New NotesSession
Dim fileNum As Integer
Dim fileName As String
fileNum% = Freefile()
fileName$ = ses.GetEnvironmentString("Directory",True) +"\test.txt"
Open fileName$ For Output As fileNum%
Print #fileNum%, "I have created a new text file"
Exit Sub

We can also create a word/Excel/Rich Text File/* by changing the extension as .doc/.xls/.rtf/.*
I think its very useful for you legends to go ahead.

No comments:

Post a Comment