Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Import an Outlook CSV file to Address Book' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Import an Outlook CSV file to Address Book
Authored by: mhuehne on Sep 02, '05 07:18:51PM

Rem - Here is some basic code to fix your problem.
Rem - vcards can be easily imported into addressbook
Rem - The guy who actually wrote this code saved my a** ...
Rem - Our corporate IS guys won't let me install any tested SW.

Rem - ============= Begin Actual Code ================
Rem - Open Microsoft Outlook and make sure C:\TEMP\Contacts exists
Rem - To access the Visual Basic Development environment, press Alt+F11.
Rem - This action opens the VBA editor.
Rem - Choose, Insert, Module from the menu. Then add the following code:
Rem - Press F5 to run the script, which places a list of all your contacts
Rem - in vCard format, in the Contacts folder C:\TEMP\Contacts
Rem - Then drag these vCards into your Address Book application
Rem - et voila, your contacts are transferred.

Const XPortPath As String = "C:\TEMP\Contacts\" 'target location

Const ext As String = ".vcf" 'file extension

Sub ExportToVCard()

Dim ns As NameSpace

Dim fld As MAPIFolder

Dim itm

Dim itms As Items

Set ns = Application.GetNamespace("MAPI")

Set fld = ns.GetDefaultFolder(olFolderContacts) 'Outlook Contacts folder

Set itms = fld.Items

itms.Sort "[LastName]", False

' The following code is the loop that builds your code

For Each itm In itms

If TypeName(itm) = "ContactItem" Then

itm.SaveAs XPortPath & itm.LastNameAndFirstName & ext, olVCard

End If

Next itm

End Sub

Rem - ============== End Actual Code =============
Rem - Cheers, Michael

---
Microsoft! What part of "NO" don't you understand?



[ Reply to This | # ]