msoutlook.org Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Speed of VBA move vs manual move, for emails moved to Public

 
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook
Author Message
RC



Joined: 08 Feb 2008
Posts: 1

PostPosted: Fri Feb 08, 2008 1:39 pm    Post subject: Speed of VBA move vs manual move, for emails moved to Public Reply with quote

Hi,

I am writing a backup routine which will automatically file/move
emails from the inbox of any of our staff, into Public Folders, using
some simple rules. We have a team of remote workers, all using Outlook
2003 connected via VPN to Exchange. When testing the code, I've found
that manually moving a standard 'test set' of emails from Inbox to
Public Folder takes (say) 20 seconds. However, when I do it in code,
using something like this:

Dim m As Outlook.MailItem
m.Move DestinationFolder

(where DestinationFolder is a Public Folder, and I do a simple loop
through all the selected emails)

the same set of emails takes more than 2 minutes to the same Public
Folder location.

I assumed that the difference must be something to do with sync-ing
Public Folders, but

a) we don't use Favorites, and
b) when I watch 'live' on the Exchange server and get somebody to move
the test set of emails from a remote location, they appear fully moved
and readable on the Exchange server within 20 seconds (in other words,
the copy operation is not being cached in some way, locally, I
believe).

What's the difference between the VBA and manual move process, and how
can I get the code-based move to emulate the manual-based move?

Thanks,

RC.

Archived from group: microsoft>public>office>developer>outlook>vba
Back to top
View user's profile Send private message
Ken Slovak - [MVP - Outlo



Joined: 12 Aug 2007
Posts: 405

PostPosted: Fri Feb 08, 2008 8:46 pm    Post subject: Re: Speed of VBA move vs manual move, for emails moved to Pu Reply with quote

The Outlook code is using Extended MAPI, which is at least 10 times faster
than using the Outlook object model from VBA, maybe more. Unless you write
your code using C++ or Delphi and Extended MAPI you won't be able to
reproduce the speed with which Outlook moves things.

There are optimization tricks that can speed things up some, but you always
will be limited by using the object model and VBA code as to how fast you
can get.

If you show your loop code someone here should be able to see if there are
any of the usual optimization tricks that would speed it up some at least.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"RC" wrote in message @c4g2000hsg.googlegroups.com...
> Hi,
>
> I am writing a backup routine which will automatically file/move
> emails from the inbox of any of our staff, into Public Folders, using
> some simple rules. We have a team of remote workers, all using Outlook
> 2003 connected via VPN to Exchange. When testing the code, I've found
> that manually moving a standard 'test set' of emails from Inbox to
> Public Folder takes (say) 20 seconds. However, when I do it in code,
> using something like this:
>
> Dim m As Outlook.MailItem
> m.Move DestinationFolder
>
> (where DestinationFolder is a Public Folder, and I do a simple loop
> through all the selected emails)
>
> the same set of emails takes more than 2 minutes to the same Public
> Folder location.
>
> I assumed that the difference must be something to do with sync-ing
> Public Folders, but
>
> a) we don't use Favorites, and
> b) when I watch 'live' on the Exchange server and get somebody to move
> the test set of emails from a remote location, they appear fully moved
> and readable on the Exchange server within 20 seconds (in other words,
> the copy operation is not being cached in some way, locally, I
> believe).
>
> What's the difference between the VBA and manual move process, and how
> can I get the code-based move to emulate the manual-based move?
>
> Thanks,
>
> RC.

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
Help writing a macro to move emails Hi: I already have some macros which move emails to predetermined folders and these macros are run with a keyboard shortcut. It works fine. I'd like to write a macro which will do the following: When I close an email (and go to the next one), I'd like

move sent items hi gurus i have a problem i have moved one email to a new folder named , say hrk how can i access this folder from window explorer? -- hemu

Move Spam macro... Hi, If anyone can help me out with this VB code in Outlook I would greatly help us out. This macro simply allows you to select multiple emails and add them to your Junk Senders.txt list then it automatically deletes the messages. What we are in search o

Move the attachment, but save the paperclip After much searching and compiling of information, I finally figured out how to loop through all of the subfolders below the Outlook Inbox, move all of the attachments to folders created using the sender's name, and add some text to each email recording w

How can I move or delete the Out-of-office-message via VBA? Peace! How can I move or delete the via VBA-Code? With the rules it is not working every time. It is not a normal mailitem, so it does not work with "mail.move". Many thank for your help! Greetings Stefan
Post new topic   Reply to topic    msoutlook.org Forum Index -> MS Office Outlook All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group