Home > Domino Tips > Administrator > Address Book > Create Test User Profile Location Documents Via Email During Database Testing
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ADDRESS BOOK

Create Test User Profile Location Documents Via Email During Database Testing


Teck Lung
11.03.1999
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


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.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Address Book
Formula language button manages Deny Access list searches
Find a Lotus Notes user within NAB Deny Access groups
Synchronize LinkedIn contacts with Lotus Notes Domino
How to correct Lotus Notes public key mismatches in four easy steps
Creating a Lotus Notes Personal Address Book replica
Admin user unable to create NAB
@Transform formula for use in R6
Change NAB while maintaining integrity of documents
NAB: A key piece of the Domino administration puzzle
Build an extended directory catalog

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

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.



Domino & Lotus Notes Security Solutions: Authentication, Antispam, Encryption and Antivirus
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts