PC Review


Reply
Thread Tools Rate Thread

Build a userform on excel to copy contacts from outlook 2003

 
 
Oggy
Guest
Posts: n/a
 
      2nd Jan 2007
I am a beginner in VBA and require abit of help. I am trying to setup a
userform on excel 2003 to select and copy into excel, names and
addresses from the contacts folder in outlook 2003. This will then save
me having my contacts in a seperate database as well as outlook.

Many thanks in advance!

 
Reply With Quote
 
 
 
 
Oggy
Guest
Posts: n/a
 
      2nd Jan 2007
Thanks Eric,

This is what i am loking for, sorry to be a pain or thick! A couple
quick questions if i may,
Does the macro go under the userform or to the combo box,
In the combo box properties which field to i need to edit so that i can
see my contacts

Thanks in advance for all your help

Regards

Oggy


Eric wrote:
> This macro should get you started. It will loop through all your Contact
> items; you can use the objContact object to retrieve Contact item properties
> for display in whatever controls you use on your UserForm.
>
> Sub LoopThroughContacts()
> On Error Resume Next
>
> Dim objContact As Outlook.ContactItem, objContactFolder As
> Outlook.MAPIFolder
> Dim objContactItems As Outlook.Items, objNS As Outlook.NameSpace
> Dim intX As Integer
>
> Set objNS = Application.GetNamespace("MAPI")
> Set objContactFolder = objNS.GetDefaultFolder(olFolderContacts)
> Set objContactItems = objContactFolder.Items
>
> For intX = 1 To objContactItems.Count
> If objContactItems.Item(intX).Class = olContact Then
> Set objContact = objContactItems.Item(intX)
> Debug.Print objContact.FullName
> End If
> Next
>
> Set objContact = Nothing
> Set objContactItems = Nothing
> Set objContactFolder = Nothing
> Set objNS = Nothing
> End Sub
>
> --
> Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
> Try Picture Attachments Wizard for Outlook:
> http://www.collaborativeinnovations.ca
> Blog: http://blogs.officezealot.com/legault/
>
>
> "Oggy" wrote:
>
> > I am a beginner in VBA and require abit of help. I am trying to setup a
> > userform on excel 2003 to select and copy into excel, names and
> > addresses from the contacts folder in outlook 2003. This will then save
> > me having my contacts in a seperate database as well as outlook.
> >
> > Many thanks in advance!
> >
> >


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call Outlook Contacts from Excel Userform RyanH Microsoft Excel Programming 3 26th Jun 2008 04:33 PM
Build a userform on excel to copy contacts from outlook 2003 Oggy Microsoft Outlook 1 2nd Jan 2007 05:48 PM
Build a userform on excel to copy contacts from outlook 2003 Oggy Microsoft Outlook VBA Programming 1 2nd Jan 2007 05:48 PM
Copy address book (contacts) from Outlook 2003 to Outlook Express? Ritter197 Microsoft Outlook Contacts 2 12th Dec 2006 06:38 PM
copy contacts from one computer to another ea. using Outlook 2003 =?Utf-8?B?RWQ=?= Microsoft Outlook Discussion 0 1st Apr 2006 03:51 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:26 PM.