dmoonme Posted April 22, 2005 Posted April 22, 2005 Hello, How can I copy and paste contact items from a Outlook public folder to a different public folder? I'm getting the contact items like this: (thanks again mark007 ;) ) Sub Main() Try Dim objOutlook As Outlook._Application objOutlook = New Outlook.Application Dim objNS As Outlook._NameSpace = objOutlook.Session Dim objFolder As Outlook.MAPIFolder = _ objNS.Folders.Item("Public Folders") objFolder = objFolder.Folders.Item("All Public Folders") objFolder = objFolder.Folders.Item("Contact Mgmt") objFolder = objFolder.Folders.Item("RC Contacts") Dim objItems As Object = objFolder.Items Dim objItem As Object For Each objItem In objItems if System.Convert.ToString(objItem.Categories).IndexOf("Staff")>-1 then Console.WriteLine(objItem.Email1Address & vbCrLf) End if Next Catch ex As Exception Console.Writeline(ex.Message) End Try End Sub Quote
mark007 Posted April 24, 2005 Posted April 24, 2005 Assuming the Contact you wish to copy is objItem and the detination folder is objFolder you would use: Dim objItem2 as Object objItem2=objItem.Copy() objItem2.Move(objFolder) Hope that helps. :) Quote Please check the Knowledge Base before you post. "Computers are useless. They can only give you answers." - Pablo Picasso The Code Net
dmoonme Posted April 25, 2005 Author Posted April 25, 2005 would that leave the copied items in the original folder or move it to the new location? I want to keep the items in the original folder as well, ie. backup. Quote
mark007 Posted April 25, 2005 Posted April 25, 2005 Yep, will copy. It creates a copy and moves the copy. :) Quote Please check the Knowledge Base before you post. "Computers are useless. They can only give you answers." - Pablo Picasso The Code Net
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.