I have a program in which I need to get emails from our exchange server. I got this from an old project :
Dim oExchService As New ExchangeService(Microsoft.Exchange.WebServices.Data.ExchangeVersion.Exchange2007_SP1)
oExchService.Credentials = New Net.NetworkCredential(strUserName, strPassword, strDomain)
oExchService.Url = New Uri(strServeur)
Dim oItemView As New ItemView(1000)
oItemView.Traversal = ItemTraversal.Shallow
Dim oLstItems As FindItemsResults(Of Item) = oExchService.FindItems(WellKnownFolderName.Inbox, oItemView)
'Importation de chaque fichier
For Each oItem As Item In oLstItems
If oItem.HasAttachments Then
End If
Next
I added the reference to Microsoft.Exchange.webservice.dll which I also got from the other project and imports the reference in the file. Everything seems fine and I can work with the member inside the classe. When I hit compile where as the imports statetement get green underlined stating the reference doens’t exists or doesn’t have any public members…
Anybody know what’s going on ?
Alright,
In the end, it was the target framework.
this Worked : http://social.technet.microsoft.com/Forums/en-US/exchangesvrdevelopment/thread/26f1a426-f42d-4bab-8245-1a77c3f09251