Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #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
  #2  
Old 08-11-2015, 02:51 AM
gmayor's Avatar
gmayor gmayor 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 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

See https://social.msdn.microsoft.com/Fo...6-3ada23ecf4ea
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 08-11-2015, 07:05 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 thx a lot !

thx a lot !
Reply With Quote
Reply

Thread Tools
Display Modes


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 04:12 AM.


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