A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Moving Contacts to another folder



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old September 19th 06, 06:34 PM posted to microsoft.public.outlook.program_vba
Jonathan B
external usenet poster
 
Posts: 1
Default Moving Contacts to another folder

Using Outlook 2003. There is a requirement at work where we move all
contacts from a particular folder to another folder on a regular basis. Is
it possible to induce "Select All" and then "Move to Folder" for Contacts in
Outlook via VBA for a folder? If not, which would be the quickest way to do
it instead of iterating through every contact item and then moving it.

I know the source folder and the target folder and only want to move the
contacts in the most efficient way. Looking forward to your suggestions.

Thanks in advance !
  #2  
Old September 19th 06, 07:33 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Moving Contacts to another folder

You can copy/move an entire folder to another location, including contents.
But for what you want you'd have to iterate the Items collection of the
folder and move each item in turn, using a down counting loop.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Jonathan B" Jonathan wrote in message
...
Using Outlook 2003. There is a requirement at work where we move all
contacts from a particular folder to another folder on a regular basis.
Is
it possible to induce "Select All" and then "Move to Folder" for Contacts
in
Outlook via VBA for a folder? If not, which would be the quickest way to
do
it instead of iterating through every contact item and then moving it.

I know the source folder and the target folder and only want to move the
contacts in the most efficient way. Looking forward to your suggestions.

Thanks in advance !


  #3  
Old September 19th 06, 08:35 PM posted to microsoft.public.outlook.program_vba
Jonathan B
external usenet poster
 
Posts: 5
Default Moving Contacts to another folder

Hi Ken,

Thank you for the quick reply.

Yes, that is what I am presently doing but find that the manual approach of
selecting all the contacts using Edit - Select All in the folder and then
moving it to the target folder seems to be fractionally quicker (especially
when the number of contacts are large). Hence the question if its possible
to get a VBA equivalent of this using the command bars or something else.

Jonathan

"Ken Slovak - [MVP - Outlook]" wrote:

You can copy/move an entire folder to another location, including contents.
But for what you want you'd have to iterate the Items collection of the
folder and move each item in turn, using a down counting loop.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Jonathan B" Jonathan wrote in message
...
Using Outlook 2003. There is a requirement at work where we move all
contacts from a particular folder to another folder on a regular basis.
Is
it possible to induce "Select All" and then "Move to Folder" for Contacts
in
Outlook via VBA for a folder? If not, which would be the quickest way to
do
it instead of iterating through every contact item and then moving it.

I know the source folder and the target folder and only want to move the
contacts in the most efficient way. Looking forward to your suggestions.

Thanks in advance !



  #4  
Old September 20th 06, 12:36 AM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Moving Contacts to another folder

It's faster because you're using the Outlook object model, which calls
Extended MAPI and Outlook is directly using Extended MAPI. If you were to
code the copy operation using Extended MAPI it would be as fast as Outlook
is.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Jonathan B" wrote in message
...
Hi Ken,

Thank you for the quick reply.

Yes, that is what I am presently doing but find that the manual approach
of
selecting all the contacts using Edit - Select All in the folder and then
moving it to the target folder seems to be fractionally quicker
(especially
when the number of contacts are large). Hence the question if its
possible
to get a VBA equivalent of this using the command bars or something else.

Jonathan


  #5  
Old September 20th 06, 02:58 PM posted to microsoft.public.outlook.program_vba
Jonathan B
external usenet poster
 
Posts: 5
Default Moving Contacts to another folder

Ken,

Thanks for information. So can Extended MAPI be implemented using VBA or
VB? I did a search since this is a relatively new arena for me but from
initial impressions it appears can't be done with VBA or VB. Am I correct?

Another issue I have noticed is that the move seems to fire the
Birthday/Anniversary date event (if present) causing duplicates in the
Calendar. Any suggestions on how I can avoid this? Currently I am capturing
the Add event and deleting it. If there is another better approach, I'm all
ears.

Thanks once again !
Jonathan


"Ken Slovak - [MVP - Outlook]" wrote:

It's faster because you're using the Outlook object model, which calls
Extended MAPI and Outlook is directly using Extended MAPI. If you were to
code the copy operation using Extended MAPI it would be as fast as Outlook
is.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Jonathan B" wrote in message
...
Hi Ken,

Thank you for the quick reply.

Yes, that is what I am presently doing but find that the manual approach
of
selecting all the contacts using Edit - Select All in the folder and then
moving it to the target folder seems to be fractionally quicker
(especially
when the number of contacts are large). Hence the question if its
possible
to get a VBA equivalent of this using the command bars or something else.

Jonathan



  #6  
Old September 20th 06, 03:03 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Moving Contacts to another folder

Extended MAPI can mostly only be programmed using C++ or Delphi. There are a
few properties you can read using MAPI from VBA but it's a hack and you
can't do complex things like moving items using VBA/VB.

You would have to do what you're doing for any reminders you don't want
replicated or clear the reminder flag on the item when you have it
instantiated and before you move it.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Jonathan B" wrote in message
...
Ken,

Thanks for information. So can Extended MAPI be implemented using VBA or
VB? I did a search since this is a relatively new arena for me but from
initial impressions it appears can't be done with VBA or VB. Am I
correct?

Another issue I have noticed is that the move seems to fire the
Birthday/Anniversary date event (if present) causing duplicates in the
Calendar. Any suggestions on how I can avoid this? Currently I am
capturing
the Add event and deleting it. If there is another better approach, I'm
all
ears.

Thanks once again !
Jonathan


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving CONTACTS to Shared Public contact folder RHill Outlook - Using Contacts 1 August 23rd 06 05:14 PM
Moving my contacts folder to a new machine Dave Outlook - Using Contacts 2 August 5th 06 05:57 PM
Moving Folder Denis R Charron Outlook - General Queries 0 June 27th 06 06:33 PM
Moving Sent Items to a different folder Dipu Jose Outlook - General Queries 1 June 1st 06 12:39 PM
Moving the contents of my Contacts folder Setnan Outlook - Using Contacts 1 May 19th 06 11:58 AM


All times are GMT +1. The time now is 08:42 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.