Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button to connection document

Status
Not open for further replies.

redbeard411

Programmer
May 21, 2002
1
US
I am creating a button to create a connection document and can fill in all the fields except the ConnectionType. Here is the code:

Sub Click(Source As Button)
'set new workspace
Dim workspace As New NotesUIWorkspace

'front end of document
Dim uidoc As NotesUIDocument

'set current document
Set uidoc = workspace.currentdocument

'define variable
Dim reason As Variant

'define variable
Dim database As Variant

'define variable
Dim server As Variant

'name of notes database between quotes
database="names.nsf"

'name of server running on between quotes
server=""

'compose document with the form called in the FORM_NAME code section.
'the main advantage of doing it this way you can also create a new
'document in a seperate database if you use the DATABASE and
'SERVER entries.
Set uidoc = workspace.ComposeDocument(server,database,"Connection")

Call uidoc.FieldSetText("ConnectionType", "0")
Call uidoc.FieldSetText("LanPortName", "TCPIP")
Call uidoc.FieldSetText("Destination", "MyBD")
Call uidoc.FieldSetText("ConnectionLocation", "*")
Call uidoc.FieldSetText("OptionalNetworkAddress","MYDB.com")
End Sub

My thought is to add a save and close @ the end then open the database I am sending with it as well. The problem is with
Call uidoc.FieldSetText("ConnectionType", "0")

It continues to wait for the click of the selection for connection type (I am using Local Area Network|0

 
I put this code in a button that the user clicks on.

Sub Click(Source As Navigator)
Messagebox "A new connection document to Server XXXXXXXXX will now be added to your Personal Address Book"
Dim ws As New notesuiworkspace
Dim session As New notessession
Dim destdb As notesdatabase
Dim newdoc As notesdocument
Dim uidoc As notesuidocument
Set destdb = New notesdatabase("","names.nsf")
Set newdoc = destdb.createdocument
newdoc.Type="Connection"
newdoc.ConnectionLocation="*"
newdoc.Form="local"
newdoc.LanPortName="TCPIP"
newdoc.PortName="TCPIP"
newdoc.ConnectionRecordFirst="1"
newdoc.DestinationDomain="*"
newdoc.DocumentAccess="[NetModifier]"
newdoc.Enabled="1"
newdoc.Destination="CN=AAAAAA/OU=BBBBBB/O=CCCCCCC"
newdoc.ConnectionType="0"
newdoc.OptionalNetworkAddress="111.222.333.444"
newdoc.PhoneNumber="111.222.333.444"
newdoc.Source=Evaluate("@V3UserName")
newdoc.Owner=session.UserName
Call newdoc.save (True,True)
Messagebox "Step successfully completed."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top