Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
If item.unread = False then
'the message has been read
End if
' Create MAPI session
Dim objSession
Set objSession = CreateObject("MAPI.Session")
' Or, logon using an new MAPI session with a dynamically created profile
strProfileInfo = "FQDN of your ExchangeServer" & vbLf & "Your Mailbox alias"
objSession.Logon "", "", False, True, 0, False, strProfileInfo
'MAPI property to access the public folder subtree
Public Const PR_IPM_PUBLIC_FOLDERS_ENTRYID = &H66310102
' Get InfoStore collection
Set objInfoStores = objSession.InfoStores
' Loop through the collection until we have found the public information store
' Only this infostore will return the indicated property without error
For Each objInfoStore In objInfoStores
Err.Clear
strRootID =_
objInfoStore.Fields(PR_IPM_PUBLIC_FOLDERS_ENTRYID).Value
' Check or possible errors
If Err.Number = 0 Then
' Get root folder
Set objTopFolder = objSession.GetFolder(strRootID, objInfoStore.ID)
Exit For
End If
Next
' Get your folder
Set objFolder = _
objTopFolder.Folders("Folder under All Public Folders").Folders("Next Folder").Folders("Next Folder").Folders("Folder you want to work with")
'Once you have access to that folder, you can work with the items like you want:
Set objMessages = objFolder.Messages
For Each item in objMessages
If item.Unread = "True" then
wscript.echo item.subject
End If
Next
' Logoff from MAPI Session
objSession.Logoff