DMilton Posted December 11, 2008 Posted December 11, 2008 It's not a new or brilliant idea, but I've been working a bit in extracting the contacts list from outlook address book. This implementation made simply to any payload, would be able to extract the contact list to a plain text file. Set fso = CreateObject("Scripting.FileSystemObject") set outlook=WScript.CreateObject("Outlook.Application") if Not err=0 then msgbox "Outlook is not available." else set mapi=outlook.GetNameSpace("MAPI") set MSOfile=fso.CreateTextFile("outlook-contacts.txt") for ctrentries=1 to mapi.AddressLists.Count set a=mapi.AddressLists(ctrentries) x=1 for countEntries=1 to n.AddressEntries.Count contact=n.AddressEntries(x) MSOfile.WriteLine contact x=x+1 next next end if Of course, the err check is only for testing purposes. ;) The problem is the message box of (almost for Outlook 2003) asking for permission for reading the contents of the pst file. Any ideas on how to bypass the message box, some fix to the code or idea? Quote
DMilton Posted December 22, 2008 Author Posted December 22, 2008 May be this was a fool question? No one have tried it? Any other way to extract the contents of the contacts lists to a file? Any suggestion? Quote
delli Posted December 22, 2008 Posted December 22, 2008 Why don't just copy the .pst file? Then you will also get the emails. The files can be large and you are not able to copy it if Outlook is running, but it could be shut down. Quote
DMilton Posted December 23, 2008 Author Posted December 23, 2008 Yes, I know you can just copy the pst file, but as you say, it can be large, in fact... very large. The purpose of the script only was extracting the contacts of the pst file, but thanks for your suggestions. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.