Results 1 to 4 of 4

Thread: VB code to save Outlook contacts

  1. #1
    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 !!

  2. #2
    Join Date
    Apr 2008
    Posts
    4,642

    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.

  3. #3
    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:

    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")
       olNs.Logon
    
     ' 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...
       olItem.Save
        
     ' 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...
       olAppt.Save
        
     ' 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."
       olMail.Send
        
     ' Clean up...
       MsgBox "All done...", vbMsgBoxSetForeground
       olNS.Logoff
       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.

  4. #4
    Join Date
    Apr 2008
    Posts
    4,088

    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.

Similar Threads

  1. Unable to save contacts in Outlook 2007
    By robin45 in forum Windows Software
    Replies: 3
    Last Post: 26-10-2009, 05:34 PM
  2. Sync Windows contacts & Outlook 2007 contacts
    By Diabloplayer in forum Windows Software
    Replies: 3
    Last Post: 21-02-2009, 11:39 AM
  3. Outlook 2003 Contacts Transfer to Outlook 2007
    By pushpendra in forum Vista Setup and Install
    Replies: 4
    Last Post: 15-09-2008, 02:15 PM
  4. Replies: 6
    Last Post: 22-12-2007, 06:21 AM
  5. Replies: 10
    Last Post: 17-11-2007, 02:21 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,586,942.78811 seconds with 16 queries