Re: Limitation with ActiveExplorer Selection?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Rafael (rafael1119_at_hotmail.com)
Date: 07/26/04

  • Next message: Sue Mosher [MVP-Outlook]: "Re: Outlook shortcut"
    Date: Mon, 26 Jul 2004 12:52:01 -0400
    
    

    Ken - Group,

    BTW: I have a Windows XP SP1+ PC with 512 MB of RAM running on a P4 2Ghtz
    The problem occurs with both my VB application and when I use VBA.

    If any of you have a CDO code I to get the count at least I would like to
    try it and see how that works. The other variable I want throw in the mix
    is the fact that I am using custom Oulook forms for my contacts on the
    Public Folders.

    Thanks for your help on this issue.

    Rafael

    "Ken Slovak - [MVP - Outlook]" <kenslovak@mvps.org> wrote in message
    news:%23AC62BybEHA.556@tk2msftngp13.phx.gbl...
    > There are a lot of factors involved, such as system resources and overall
    > RAM and virtual memory size. I've seen loops that worked correctly on my
    dev
    > machines cause out of memory errors on client's machines because of that.
    > There's a long-standing bug in how Outlook handles iterating collections
    of
    > items in loops. It creates internal variables that aren't released until
    > after the procedure exits and it gets worse the more dot operators you
    use,
    > since Outlook creates internal variables for each suboperator in the dots.
    > That's why using CDO 1.21 code works for loops like that, it doesn't
    create
    > those internal variables and can handle looping over much larger
    collections
    > than Outlook code can.
    >
    > As far as specific limits on Selection, there aren't any hard and fast
    > rules. It just seems to break at some point.
    >
    > --
    > 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
    >
    >
    > "John Riddle" <JohnRiddle@discussions.microsoft.com> wrote in message
    > news:57012B59-C5DD-4FC7-9B30-ED028B05E58E@microsoft.com...
    > > In my version of Outlook (2003), when I select a large number of items
    for
    > processing, I generally run into memory problems after a couple hundred or
    > so. However, I can very easily select several thousand and get a count
    > (Selection.Count). I can't understand at all why he would be having a
    > problem with that.
    > >
    > > Also, even if I only select a few dozen at a time and loop through them
    > with a For...Next loop such as:
    > >
    > > Dim candFolder As MAPIFolder
    > > Set candFolder = Application.ActiveExplorer.CurrentFolder
    > > If candFolder.DefaultItemType = olContactItem Then
    > > strJobTitle = "Manager"
    > > strDepartment = "IT"
    > > For Each cand In Application.ActiveExplorer.Selection
    > > cand.JobTitle = strJobTitle
    > > cand.Department = strDepartment
    > > cand.Save
    > > Set cand = Nothing
    > > Next
    > > strJobTitle = ""
    > > strDepartment = ""
    > > End If
    > > Set candFolder = Nothing
    > >
    > > This code produces "Out of memory." errors if more than a couple hundred
    > items are selected AND oddly enough, if I select only a couple dozen and
    > process them, then select a couple dozen different items and process them
    > and so on in stages like this, I still get memory errors after a few
    > hundred. I'm convinced that processing items using the Selection
    collection
    > has memory problems.
    > >
    > > Can you re-create this scenario Ken?
    > >
    > > John
    >
    >


  • Next message: Sue Mosher [MVP-Outlook]: "Re: Outlook shortcut"

    Relevant Pages

    • Re: Limitation with ActiveExplorer Selection?
      ... RAM and virtual memory size. ... I've seen loops that worked correctly on my dev ... since Outlook creates internal variables for each suboperator in the dots. ... > Set candFolder = Application.ActiveExplorer.CurrentFolder ...
      (microsoft.public.outlook.program_forms)
    • Re: "Mastering C Pointers"....
      ... all means go ahead and dive right into the C language. ... Memory is a separate unit which just stores bits. ... A pointer at the hardware level _is an integer_. ... since loops make your logic more much ...
      (comp.lang.c)
    • Re: Outlook out of memory after installing SP2
      ... In the german access newsgroup there are people which have similar problems with access after installing sp2! ... The message I get is: "Outlook doesn't have ... enough memory to start operation of services. ... Should I reset my system to a point before the SP2 installation? ...
      (microsoft.public.outlook.general)
    • Re: Best Performance File Compare: MD5/SHA1 or Byte-by-Byte Checking?
      ... you might want to use the method that loops ... the entire contents of the two files into memory. ... comparing the chunks, you are going to make the process much more efficient. ... What about MD5? ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: Application.ActiveExplorer().Selection fails in C# application
      ... if this happens on more than one machine I'd rule out a bad memory stick. ... For the starting Outlook using code if no UI is shown then obviously ActiveExploreris going to be null unless you add UI. ... I'm not sure why you're getting access violations, ... Please note that I have tried to set macro security to "No security control ...
      (microsoft.public.outlook.interop)