B
Barmaley
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
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