
ADDRESS BOOK
Create Test User Profile Location Documents Via Email During Database Testing
Teck Lung 11.03.1999
Rating: --- (out of 5)




Developers always have to go to the user's PC to create location documents for testing IDs in order to manually switch them during testing of a new database. This is a lot of work. Why not email your users a hotspot button and let them do all the rest of the work for you?
I have created a function so that you just need to plug in all the basic information like Home Mail Server, mail file filepath, ID filepath etc. The next thing to do is to create a hotspot button and email it out to your users. Try it and feedback to me how it works for you!!! :-)
Code
(1) Syntax: ----------- iReturn = CreateLocation (session, strLocationType$, strName$, strMailServer$, strMailFile$, strDomain$, strUserID$)
(2) Function: ------------- Function CreateLocation (session As NotesSession, _ strLocationType As String, strName As String, strMailServer As String, _ strMailFile As String, strDomain As String, strUserID As String) As Integer %REM This function will create a new location document in user's local address book. INPUT PARAMETERS: (1) session - a connected Notes session, (2) strLocationType "0" for Local Area Network, "1" for Dialup Modem, "2" for Both Dialup & Local Area Network, "3" for No connection (3) strName - a description given to the location (4) strMailServer - the fully qualified Mail Server name (5) strMailFile - the file path for the targeted user's mail file (6) strDomain - the mail domain name (7) strUserID - the file path for the user ID. %END REM Dim db As NotesDatabase Dim doc_location As NotesDocument Set db = session.GetDatabase("","names.nsf") CreateLocation = True Set doc_location = db.CreateDocument If doc_location Is Nothing Then CreateLocation = False Exit Function End If doc_location.Form = "Location" doc_location.Type = "Location" doc_location.Source = "*" doc_location.LocationType= strLocationType If doc_location.LocationType(0) = "0" Or _ doc_location.LocationType(0) = "2" Then doc_location.MailType = "0" doc_location.MailTypeDirect = "0" doc_location.MailTypeLocal = "1" Elseif doc_location.LocationType(0) = "1" Or _ doc_location.LocationType(0) = "3" Then doc_location.MailType = "1" doc_location.MailTypeDirect = "0" doc_location.MailTypeLocal = "1" End If doc_location.Name = strName doc_location.MailServer = strMailServer doc_location.MailFile = strMailFile doc_location.Domain = strDomain doc_location.UserID = strUserID doc_location.ComputeWithForm False,False doc_location.Save True,False End Function
(3) Example ----------- In the Click event of a button:- Sub Click(Source As Button) Dim session As New NotesSession strLocationType$ = "0" strName$ = "Teck Lung" strMailServer$ = "ORGNAME/ORGUNIT/ORG" strMailFile$ = "mail ecklung.nsf" strDomain$ = "ORGDOMAIN" strUserID$ = "c:
otesdata ecklung.id" If CreateLocation (session, strLocationType$, strName$, strMailServer$, strMailFile$, strDomain$, strUserID$) = False Then Msgbox "!!!Error creating location document." End If End Sub
 |

|
Rate this Tip
|
To rate tips, you must be a member of SearchDomino.com. Register now
to start rating these tips. Log in if you are already a member.
|


');
// -->
DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.
|
 |
|
|
 |
|
 |