Hiya,
With VBA, I'm trying to retrieve messages from an IMAP folder in Outlook 98 (the sub runs from Excel 2002 though).
I can get the string name of the IMAP Root folder! Like this
This gives me the correct name IMAPSP Folders <Server Name>
However, I need to get to a folder within that root folder called "Inbox". When I do
I get count = 0 so No Subfolders? How do I make objFolder point to "Inbox" (or is that just the name that appears in Outlook and really it's called something else?)
I've tried using Outlook Spy to get the MAPI info I need to access the folder, but I just get MAPI_E_NOT_AVAILABLE so that's not much use.
Someone please help!
With VBA, I'm trying to retrieve messages from an IMAP folder in Outlook 98 (the sub runs from Excel 2002 though).
I can get the string name of the IMAP Root folder! Like this
Code:
Set objOL = New Outlook.Application
Set olNS = objOL.GetNamespace("MAPI")
Set objFolder = olNS.Folders.Item(1)
y = olNS.Folders.Item(1).Name
MsgBox "Name of item 1 = " & y
This gives me the correct name IMAPSP Folders <Server Name>
However, I need to get to a folder within that root folder called "Inbox". When I do
Code:
x = objFolder.Items.count
MsgBox "Items = " & x
I've tried using Outlook Spy to get the MAPI info I need to access the folder, but I just get MAPI_E_NOT_AVAILABLE so that's not much use.
Someone please help!