Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27196

Custom EWS Class - FindFolders help

$
0
0
Hello everyone, I have downloaded the sourcecode for http://www.codeproject.com/Articles/...65#xx4626665xx and I am trying to make it so that I can get items from a specific folder that is NOT the inbox. If anyone is familiar with it, or has the chance to play with the class, please help.

Here is the code I have so far.

vbNET Code:
  1. '' Since this is not a folder search we opt for Shallow Traversal Type
  2.             'Dim findItemRequest As New FindItemType()
  3.             'findItemRequest.Traversal = ItemQueryTraversalType.Shallow
  4.  
  5.             Dim findFolderRequest As New FindFolderType
  6.             findFolderRequest.Traversal = FolderQueryTraversalType.Shallow
  7.  
  8.  
  9.             '' The BaseShape property Gets or Sets the requested
  10.             '' properties to return in a response
  11.             'Dim itemProperties As New ItemResponseShapeType()
  12.             'itemProperties.BaseShape = DefaultShapeNamesType.AllProperties
  13.             Dim folderProperties As New FolderResponseShapeType
  14.             folderProperties.BaseShape = DefaultShapeNamesType.IdOnly
  15.  
  16.             '' Here the item shape property is set, Go To definition on
  17.             '' FindItemType for more info
  18.             'findItemRequest.ItemShape = itemProperties
  19.             findFolderRequest.FolderShape = folderProperties
  20.  
  21.  
  22.             '' Setup a folder array and define the folder Name and then set the parent
  23.             '' folder ID Field with it to filter the search to just the inbox.
  24.             Dim folderIDArray As DistinguishedFolderIdType() = New DistinguishedFolderIdType(0) {}
  25.             folderIDArray(0) = New DistinguishedFolderIdType()
  26.             folderIDArray(0).Id = DistinguishedFolderIdNameType.inbox
  27.             findfolderRequest.ParentFolderIds = folderIDArray
  28.            
  29.  
  30.             '' This block initiates the reading of the messages,
  31.             '' Declares variables for the folder and items in that folder
  32.             'Dim findItemResponse As FindItemResponseType = exchangeServer.FindItem(findItemRequest)
  33.             'Dim folder As FindItemResponseMessageType = _
  34.             'DirectCast(findItemResponse.ResponseMessages.Items(0), FindItemResponseMessageType)
  35.             'Dim folderContents As New ArrayOfRealItemsType()
  36.             'folderContents = DirectCast(folder.RootFolder.Item, ArrayOfRealItemsType)
  37.             'Dim items As ItemType() = folderContents.Items
  38.  
  39.             Dim findFolderReponse As FindFolderResponseType = exchangeServer.FindFolder(findFolderRequest)


from the last line of my code, I need to get to here:

Name:  codeoutline.png
Views: 92
Size:  19.5 KB
Attached Images
 

Viewing all articles
Browse latest Browse all 27196

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>