PC Review


Reply
Thread Tools Rate Thread

VBA Outlook Contacts problem

 
 
New Member
Join Date: Jun 2012
Posts: 1
 
      22nd Jun 2012
Hi,

I'm beginner in the VBA, so I know that it's could be silly problem, but I unfortunately I can't find any solution. I simply want to move every contacts from default folder ("Contacts") to another created be my (for example "Archive Contacts"). Its nessesary for me to run another script written by another person. So i write this:

Sub copy_all()

Dim NM As Outlook.Namespace
Dim Oul As New Outlook.Application
Dim currentItem As Object
Dim currentContact As Outlook.ContactItem
Dim contactFolder As Outlook.Folder
Dim newFolder As Outlook.Folder




Set NM = Oul.GetNamespace("MAPI")
Set contactFolder = NM.Folders(1).Folders("Contacts")

Set newFolder = contactFolder.Folders.Add("Moja_kopia_kontaktow")

For Each currentItem In contactFolder.Items
If (currentItem.Class = olContact) Then
Set currentContact = currentItem

currentContact.Move (newFolder)

End If

Next


End Sub


But I get error from Debugger that: "Object is required", I dont know what I'm doing wrong

I would be very helpful for any advice and help
Greets
 
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
How do I syncronize my Access contacts with Outlook contacts while keeping my Access contacts as the tmmogirl Webmaster / Programming 0 20th Jul 2012 08:15 PM
How do I copy the contacts in Contacts 01 to Contacts 02? =?Utf-8?B?TU9FIERFU0lHTg==?= Microsoft Outlook Contacts 1 12th Aug 2007 01:10 PM
How do I move contacts from contacts to business contacts? =?Utf-8?B?VG9kZCBGaXR6?= Microsoft Outlook BCM 3 13th Apr 2007 11:24 PM
How do I COPY contacts from my contacts TO the buisness contacts =?Utf-8?B?TE1UIDE=?= Microsoft Outlook BCM 1 7th Apr 2006 09:19 PM
new contacts go into oe contacts instead of outlook contacts Paul Microsoft Outlook Contacts 3 8th Sep 2004 11:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:06 PM.