Hello,
Any progress on your project? I’ve added a VB version of demo, thought it might be helpful. If you have any features request, please post it here, We’d be happy to hear that.
[VB.NET]
Imports Aspose.Network.Data.OutlookClient
Module Module1
Sub Main()
Dim connection As Aspose.Network.Data.OutlookClient.OutlookConnection
Dim cmd As Aspose.Network.Data.OutlookClient.OutlookCommand
Dim adapter As Aspose.Network.Data.OutlookClient.OutlookDataAdapter
'init
connection = New OutlookConnection()
cmd = New OutlookCommand
adapter = New OutlookDataAdapter()
'print out available connections:
PrintAvailableConnection(connection)
Dim connectionList As ArrayList
connectionList = connection.GetConnectionList()
'choose the first connection
connection.ConnectionString = connectionList(0).ToString()
'set OutlookCommand’s connection
cmd.Connection = connection
'set adapter’s command
adapter.SelectCommand = cmd
'available folders:
PrintAvailableOutlookFolders(cmd)
'command text
cmd.CommandText = “SELECT * FROM Inbox”
Dim resultSet As System.Data.DataSet
resultSet = New DataSet()
adapter.Fill(resultSet)
'simply print out this dataset
PrintMessages(resultSet)
Console.WriteLine(vbNewLine & “press Enter to exit…”)
Console.Read()
End Sub
Sub PrintAvailableConnection(ByVal connection As Aspose.Network.Data.OutlookClient.OutlookConnection)
Dim connectionList As ArrayList
connectionList = connection.GetConnectionList()
Console.WriteLine(“Available connections to outlook:”)
For i As Integer = 0 To connectionList.Count - 1
Console.WriteLine(connectionList(i).ToString())
Next
End Sub
Sub PrintAvailableOutlookFolders(ByVal command As Aspose.Network.Data.OutlookClient.OutlookCommand)
Dim folders As Outlook.Folders
folders = command.GetFolders()
Console.WriteLine(“Available folders:”)
For i As Integer = 1 To folders.Count - 1
Console.WriteLine(folders.Item(i).Name)
Next
End Sub
Sub PrintMessages(ByVal resultSet As System.Data.DataSet)
Dim messages As System.Data.DataTable
messages = resultSet.Tables(0)
For i As Integer = 0 To messages.Rows.Count - 1
For j As Integer = 0 To messages.Columns.Count - 1
Console.Write(messages.Columns(j).ToString() & “:”)
Console.WriteLine(messages.Rows(i)(j).ToString())
Next
Next
End Sub
End Module
Demo project and required dll could be downloaded here:
[Http://www.aspose.com/products/Aspose.Network/tmp/outlookdemovb.zip ](https://forum.aspose.com/products/Aspose.Network/tmp/outlookdemovb.zip)
Thank you.