Go Back   TechArena Community > Software > Windows Software
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Thread Tools Search this Thread
Old 27-06-2009
Join Date: Feb 2009
Posts: 55
VB code to save Outlook contacts

hi everyone,

I have added number of contacts in my Outlook Express. Actually, I need to save all of these Outlook contacts using VB code. Can anyone please suggest me how can I use Vb code to save Outlook contacts ?
Any ideas !!
Reply With Quote
Old 27-06-2009
Join Date: Apr 2008
Posts: 4,641
Re: VB code to save Outlook contacts

I would suggest you to download one of the best outlook vb coder software Icesun Outlook Backup
  • Icesun Outlook Backup is a backup and restore tool for the Microsoft Outlook.
  • It allows you to save personal folders, contacts, personal address book, mail folders, mail accounts, message rules, signatures, stationery, tasks, notes, calendar, templates, and all personal settings.
  • It allows you to backup data on one computer and restore it to another one

Advantages - easy to use, simplified user interface, very useful fo beginners.
Reply With Quote
Old 27-06-2009
Join Date: Apr 2008
Posts: 2,139
Re: VB code to save Outlook contacts

Follow the steps :

1. Start Visual Basic, and create a new Standard EXE project.
2. From the Project menu, choose References and select Microsoft Outlook.
3. Add a button to your form.
4. Double-click the button, and then add the following code:

' Start Outlook.
 ' If it is already running, you'll use the same instance...
   Dim olApp As Outlook.Application
   Set olApp = CreateObject("Outlook.Application")
 ' Logon. Doesn't hurt if you are already running and logged on...
   Dim olNs As Outlook.NameSpace
   Set olNs = olApp.GetNamespace("MAPI")

 ' Create and Open a new contact.
   Dim olItem As Outlook.ContactItem
   Set olItem = olApp.CreateItem(olContactItem)

 ' Setup Contact information...
   With olItem
      .FullName = "James Smith"
      .Birthday = "9/15/1975"
      .CompanyName = "Microsoft"
      .HomeTelephoneNumber = "704-555-8888"
      .Email1Address = "someone@microsoft.com"
      .JobTitle = "Developer"
      .HomeAddress = "111 Main St." & vbCr & "Charlotte, NC 28226"
   End With
 ' Save Contact...
 ' Create a new appointment.
   Dim olAppt As Outlook.AppointmentItem
   Set olAppt = olApp.CreateItem(olAppointmentItem)
 ' Set start time for 2-minutes from now...
   olAppt.Start = Now() + (2# / 24# / 60#)
 ' Setup other appointment information...
   With olAppt
      .Duration = 60
      .Subject = "Meeting to discuss plans..."
      .Body = "Meeting with " & olItem.FullName & " to discuss plans."
      .Location = "Home Office"
      .ReminderMinutesBeforeStart = 1
      .ReminderSet = True
   End With
 ' Save Appointment...
 ' Send a message to your new contact.
   Dim olMail As Outlook.MailItem
   Set olMail = olApp.CreateItem(olMailItem)
 ' Fill out & send message...
   olMail.To = olItem.Email1Address
   olMail.Subject = "About our meeting..."
   olMail.Body = _
        "Dear " & olItem.FirstName & ", " & vbCr & vbCr & vbTab & _
        "I'll see you in 2 minutes for our meeting!" & vbCr & vbCr & _
        "Btw: I've added you to my contact list."
 ' Clean up...
   MsgBox "All done...", vbMsgBoxSetForeground
   Set olNs = Nothing
   Set olMail = Nothing
   Set olAppt = Nothing
   Set olItem = Nothing
   Set olApp = Nothing
5. Run the project, and click the button to run the code.
Reply With Quote
Old 27-06-2009
Join Date: Apr 2008
Posts: 4,086
Re: VB code to save Outlook contacts

Eastsea Outlook Backup 1.80 is another yet very similar tool as Icesun Outlook Backup which supports Windows platform.
Reply With Quote

  TechArena Community > Software > Windows Software
Tags: ,

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Similar Threads for: "VB code to save Outlook contacts"
Thread Thread Starter Forum Replies Last Post
Unable to save contacts in Outlook 2007 robin45 Windows Software 3 26-10-2009 05:34 PM
Sync Windows contacts & Outlook 2007 contacts Diabloplayer Windows Software 3 21-02-2009 11:39 AM
Outlook 2003 Contacts Transfer to Outlook 2007 pushpendra Vista Setup and Install 4 15-09-2008 02:15 PM
Importing Contacts from Outlook CSV to Vista Contacts rocktrng Vista Help 6 22-12-2007 06:21 AM
Outlook 2007 won't save passwords in Vista...save password box che Craig Vista Help 10 17-11-2007 02:21 AM

All times are GMT +5.5. The time now is 01:37 PM.