Home > Domino Tips > Administrator > Address Book > LotusScript to detach userid files from address book
Domino Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ADDRESS BOOK

LotusScript to detach userid files from address book


Vijay Khanna
05.05.2003
Rating: -3.64- (out of 5)


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


I was faced with a tricky issue of detaching all users id files from address book and saving them on hard disk. Also I had to delete the id files from address book after the copy.

This script Renames the users id files as Shortname_Firstname_Lastname.id and stores them in c:attach folder. Remember to make the folder before executing the script.

This method also logs the names of all persons for which it has detached the id's.



Code

Sub Initialize 

Dim currentLog As New NotesLog
( "Script log" )
Call currentLog.OpenFileLog
( "c:attachlog.txt" )
Dim s As New notessession
Dim db As notesdatabase
Set db = s.currentdatabase
Dim doc As notesdocument
Dim view As notesview
Dim object As NotesEmbeddedObject
Set view = db.getview("People")
Set doc = view.getfirstdocument
Dim vc As NotesViewEntryCollection 
Set vc = view.AllEntries
Set object = doc.GetAttachment( "userid" ) 
Messagebox vc.count


For i = 2 To vc.count
Set object = doc.GetAttachment( "userid" )

If ( object Is Nothing ) Then

Call currentLog.LogAction( "UN_Successfull 
: " &doc.shortname(0) & ":" &doc.
FirstName(0) & ":" & doc.LastName(0))

Set doc = view.GetNthDocument(i) 
Else 

Call currentLog.LogAction( "Successfull 
: " & doc.shortname(0) & ":" &doc.
FirstName(0) & ":" & doc.LastName(0))
Call object.ExtractFile ( "c:Attach" & doc.
shortname(0) & "_" &doc.FirstName(0) 
& "_" & doc.LastName(0) & ".id")
Call object.Remove 
Call doc.save(True,True)

Set doc = view.GetNthDocument(i)
End If


Next

Messagebox "finished"

Call currentLog.Close



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

LotusScript
LotusScript agent parses ACL to Microsoft Notepad
LotusScript finds the first occurrence of a string from the right
Clear Recent Contacts view and prevent repopulation in Lotus Notes 8.x
Search Microsoft Active Directory with LotusScript
Three steps to trap and handle save conflicts with LotusScript
Troubleshoot agents by displaying LotusScript variables online
LotusScript sorts lists alphabetically
Run or restart Notes/Domino agents via text messages
LotusScript code rebuilds corrupted busytime.nsf file
Soft-code item names to facilitate LotusScript management

Lotus Notes Domino Access, Permissions and Authentication
Display Lotus Notes user group membership details in a tree view
How DirLint verifies data in Lotus Notes Domino 8 directories
Fix and update Lotus Notes documents with limited access
Lotus Notes access error: 'database is not opened yet'
Formula language button manages Deny Access list searches
Update the ACL from the Roles view with LotusScript
Secure Lotus Notes 8 with the Internet password lockout feature
Find a Lotus Notes user within NAB Deny Access groups
Move a Lotus Domino server to a new certifier without a reinstall
Troubleshoot Lotus Notes Out of Office (OOO) agent error messages

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