Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-11-2015, 12:14 AM
bartoch bartoch is offline VBA - Outlook 2010 - Copy a contact list to a contact list in the public folder Windows 7 64bit VBA - Outlook 2010 - Copy a contact list to a contact list in the public folder Office 2010 64bit
Novice
VBA - Outlook 2010 - Copy a contact list to a contact list in the public folder
 
Join Date: Aug 2015
Posts: 2
bartoch is on a distinguished road
Default VBA - Outlook 2010 - Copy a contact list to a contact list in the public folder

I have make a script for copy a contact list to a contact list in the public folder but if i'm not on the contact source , the macro don't work, i don't know why, thx.



I things the error come from:
Set objItem = Application.ActiveExplorer.Selection.Item(1)


Sub Movecopycontacts()

Dim objOutlook As Outlook.Application
Dim objNamespace As Outlook.NameSpace
Dim objSourceFolder As Outlook.MAPIFolder
Dim objDestFolder As Outlook.MAPIFolder
Dim objItem As ContactItem

Set objOutlook = Application
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objSourceFolder = objNamespace.GetDefaultFolder(olFolderContacts)
Set objItem = Application.ActiveExplorer.Selection.Item(1)
Set objDestFolder = objNamespace.Folders("Public folder - oky@test.com").Folders("all public folder").Folders("test")

objItem.Move objDestFolder

Set objDestFolder = Nothing
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
outlook 2013 contact list problem dingil Outlook 0 07-17-2015 06:25 AM
Categories (2010) - how to edit drop down list for assignment to contact NancyZ Outlook 0 07-10-2015 06:20 AM
HelP !!!! MS Outlook - Contact List + Merge JenGoh Outlook 1 01-25-2011 04:26 PM
VBA - Outlook 2010 - Copy a contact list to a contact list in the public folder How to copy contact list to another programme ksimmonds Outlook 2 01-13-2011 06:46 AM
Can't Send Fax using exchange public contact folder carlos.jm Outlook 0 05-31-2006 01:11 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:37 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft