I am new to Visual Basic. I am trying to use the Selection datatype in VBA for an array. However, when I select more than 256 items, they no longer display in the debugger. For example, it knows that the count is 590 items, but it only actually registers 256 as items. Is that the limit? If so, how do I change my code to account for that? I would like to be able to select as many items as possible. Here is a snippet of my current code:
Dim Selection As Selection
Set Selection = currentExplorer.Selection
Print #n, Now & ": " & "Starting count on items in selection: " & Selection.Count
For Each obj In Selection
Set olItem = obj
I think I'm getting an overflow here because after 255 emails, the categories start displaying more than one, which is not what it is supposed to do:
emailCategory = olItem.Categories
Print #n, Now & ": " & "Email Category: " & emailCategory
I looked at the possible duplicate question. I don't want this to just work in the debugger. This is affecting my code in general and is miscategorizing items as things they should not be categorized as. (By categorized, I mean the categories you can add in Outlook.)
Please let me know if I need to add more context or anything. I will try to do my best. Thanks.