Problem the the code?

I tried adding the following code to an email using buttons. But got an error… As this code was extracted from this forum, I’m nuts about the correct syntax to use. Pls advise! Thanks.

Dim nab As NotesDatabase

Set nab = New NotesDatabase( “”, “names.nsf” )

Dim conndoc As NotesDocument

Set conndoc = New NotesDocument(nab)

conndoc.form = “Connection”

conndoc.ConnectionType = “0”

conndoc.Destination = “CN=Notes/O=ABC”

conndoc.LanPortName = “TCPIP”

conndoc.PortName = “TCPIP”

conndoc.ConnectionLocation = “*”

conndoc.OptionalNetworkAddress = “10.8.8.8”

conndoc.PhoneNumber = “10.8.8.8”

conndoc.ConnectionLocation = “*”

conndoc.Type = “Connection”

conndoc.ConnectionRecordFirst=“1”

conndoc.Source=“*”

connDoc.ComputeWithForm False, False

Call conndoc.Save( True, True )

Subject: Problem the the code?

It would really help if you could say what the error is and on which line it occurs.

However, my first guess is that you don’t have permission to create documents in the NAB.

Frunobulax