Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
retreiving number of e-mails from public folder in Outlook, next step
Well, on my machine this approach worked:
Set Fldr = olNs.Folders("Personal Folders").Folders("My Folder") Debug.Print Fldr.Name & " has " & Fldr.Items.Count & " items" I don't have the Exchange environment here, but you should be able to "drill" down into as many folders as you need. Yours may end up being something along the lines of: Set Fldr = olNs.Folders("Public Folders").Folders("All Public Folders"). _ Folders("My Folder") "Barmaley" wrote in message ... With the help of Dick Kusleika and Chip Pearson I have managed to arrive to this code, which checks e-mails in InBox. I couldn't figuire out how to change Set Fldr = olNs.GetDefaultFolder(olFolderInbox) to extract e-mail info from Public Folder that reside on Exchange server. Folder structure looks like this: "Public Folders-All Public Folders-Custom Folder" etc (it has couple more subfolders) Can anyone help me please? Sub GetFromInbox2() Dim olApp As Outlook.Application Dim olNs As NameSpace Dim Fldr As MAPIFolder Dim olMail As Variant Dim i As Integer Set olApp = New Outlook.Application Set olNs = olApp.GetNamespace("MAPI") Set Fldr = olNs.GetDefaultFolder(olFolderInbox) i = 1 For Each olMail In Fldr.Items If InStr(olMail.ReceivedTime, Range("F1")) 0 Then ActiveSheet.Cells(i, 1).Value = olMail.ReceivedTime i = i + 1 End If Next olMail Set Fldr = Nothing Set olNs = Nothing Set olApp = Nothing End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
where the archieve folder deleted mails are stored | Setting up and Configuration of Excel | |||
Saving Excel E Mails in a Word Folder | Setting up and Configuration of Excel | |||
How do I link to an Outlook public folder from an Excel spreadshe. | Excel Discussion (Misc queries) | |||
retreiving number of e-mails from public folder in Outlook | Excel Programming | |||
retreiving number of e-mails from public folder in Outlook | Excel Programming |