Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. help

help

Scheduled Pinned Locked Moved Visual Basic
helpsysadmintestingtoolsquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MagicGirL83
    wrote on last edited by
    #1

    hi.. i've used outlook automation to extract e-mails from our exchange server.. my problem is i can't think of any control that can hold the e-mails.. when i use a listbox, it takes like 10 mins to download the contents of my e-mail.. what control can u suggest so it will load faster? thanks.. here's my code: Dim ol As Outlook.Application Dim olns As Outlook.NameSpace Dim myRecipient, myfolder, numitems, myitems Dim i As Integer ol = New Outlook.Application olns = ol.GetNamespace("MAPI") myRecipient = olns.CreateRecipient("ITMC L2 DSS-ALERT HUB") myRecipient.Resolve() myfolder = olns.GetSharedDefaultFolder _ (myRecipient, Outlook.OlDefaultFolders.olFolderInbox) MsgBox("You have " & myfolder.items.count & " message", vbInformation) numitems = myfolder.Items.Count myitems = myfolder.Items For i = 1 To numitems ListBox1.Items.Add(myitems(i).subject) Next

    E D 2 Replies Last reply
    0
    • M MagicGirL83

      hi.. i've used outlook automation to extract e-mails from our exchange server.. my problem is i can't think of any control that can hold the e-mails.. when i use a listbox, it takes like 10 mins to download the contents of my e-mail.. what control can u suggest so it will load faster? thanks.. here's my code: Dim ol As Outlook.Application Dim olns As Outlook.NameSpace Dim myRecipient, myfolder, numitems, myitems Dim i As Integer ol = New Outlook.Application olns = ol.GetNamespace("MAPI") myRecipient = olns.CreateRecipient("ITMC L2 DSS-ALERT HUB") myRecipient.Resolve() myfolder = olns.GetSharedDefaultFolder _ (myRecipient, Outlook.OlDefaultFolders.olFolderInbox) MsgBox("You have " & myfolder.items.count & " message", vbInformation) numitems = myfolder.Items.Count myitems = myfolder.Items For i = 1 To numitems ListBox1.Items.Add(myitems(i).subject) Next

      E Offline
      E Offline
      Edbert P
      wrote on last edited by
      #2

      This doesn't answer your question, but check Outlook Redemption[^] [www.dimastr.com] if you're working with Outlook. I used this to remove those annoying warning dialog when accessing user data. Edbert

      1 Reply Last reply
      0
      • M MagicGirL83

        hi.. i've used outlook automation to extract e-mails from our exchange server.. my problem is i can't think of any control that can hold the e-mails.. when i use a listbox, it takes like 10 mins to download the contents of my e-mail.. what control can u suggest so it will load faster? thanks.. here's my code: Dim ol As Outlook.Application Dim olns As Outlook.NameSpace Dim myRecipient, myfolder, numitems, myitems Dim i As Integer ol = New Outlook.Application olns = ol.GetNamespace("MAPI") myRecipient = olns.CreateRecipient("ITMC L2 DSS-ALERT HUB") myRecipient.Resolve() myfolder = olns.GetSharedDefaultFolder _ (myRecipient, Outlook.OlDefaultFolders.olFolderInbox) MsgBox("You have " & myfolder.items.count & " message", vbInformation) numitems = myfolder.Items.Count myitems = myfolder.Items For i = 1 To numitems ListBox1.Items.Add(myitems(i).subject) Next

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        That depends on what part of the code is taking so long and how many items your adding to the ListBox. If it's the part that's adding items to the ListBox, I noticed that you'r not preventing the control from redrawing itself every time you add an item to the control. You might want to scrap iterating through the items yourself and just use the .AddRange(Object()) method of the Items property. I think something like this should work:

        ListBox1.DisplayMember = "Subject"
        ListBox1.Items.AddRange( myItems )

        RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups