Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default retreiving number of e-mails from public folder in Outlook

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
where the archieve folder deleted mails are stored Hani Setting up and Configuration of Excel 1 May 22nd 08 04:54 PM
Saving Excel E Mails in a Word Folder HNL Setting up and Configuration of Excel 1 September 16th 06 10:23 AM
Import of Outlook Mails to Excel Sheet Ajay Setting up and Configuration of Excel 6 July 24th 05 11:39 PM
How do I link to an Outlook public folder from an Excel spreadshe. DJBaker Excel Discussion (Misc queries) 0 January 28th 05 07:35 PM
retreiving number of e-mails from public folder in Outlook Barmaley Excel Programming 1 July 15th 03 09:47 PM


All times are GMT +1. The time now is 01:21 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"