Populate a field

Need to populate a field in lotus notes with the name of the machine the user is currently logged on.Pliz help me with the code.

Subject: Populate a field

You’d need to put something in the PostOpen:

Declare Function GetComputerName Lib “kernel32” Alias _

“GetComputerNameA” (Byval lpBuffer As String, lSize As Long) As Long

Function getThisComputerName() As String

Dim lLenName As Long

Dim retVal As Long

Dim sCompName As String * 255

lLenName = 255

retVal = getComputerName(sCompName, lLenName)

If retVal <> 0 Then

	getThisComputerName = Left$(sCompName, lLenName)

Else

	getThisComputerName = "Unknown"

End If

End Function

Sub Postopen…

Source.Document.computerName = getThisComputerName()

End Sub

HTH - Rufus.