Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.
I'm running this on my PC which has 3 Outlook Profiles: "Wade Chestnut" (default), "Recruiter" and "Archive". The "Recruiter" is the one I want to be able to select, but it doesn't prompt for a Profile and Inbox messages are pulled from my Account . I do receive the warning prompt from Outlook 2010 about a program trying to access e-mail addresses but never the prompt for the Profile even though I have the 3rd Logon parameter set to True which is "Show Dialog as Object".
Imports System.Reflection Imports Microsoft.Office.Interop Public Class Form1 Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click ' Create Outlook application. Dim oApp As Outlook.Application = New Outlook.Application() ' Get Mapi NameSpace. Dim oNS As Outlook.NameSpace = oApp.GetNamespace("MAPI") oNS.Logon("Recruiter", Missing.Value, True, True) ' Get Messages collection of Inbox. Dim oInbox As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox) Dim oItems As Outlook.Items = oInbox.Items Label1.Text = "Total : " & oItems.Count ' Get unread e-mail messages. 'oItems = oItems.Restrict("[Unread] = true") Label2.Text = "Total Unread : " & oItems.Count ' Loop each unread message. Dim oMsg As Outlook.MailItem Dim i As Integer For i = 1 To oItems.Count oMsg = oItems.Item(i) DataGridView1.Rows.Add(i, oMsg.SenderName, oMsg.Subject, oMsg.ReceivedTime, oMsg.Body) Next ' Log off. oNS.Logoff() ' Clean up. oApp = Nothing oNS = Nothing oItems = Nothing oMsg = Nothing End Sub End Class
|How to retrieve a mysql date column that has 0000-00-00 in vb.net||8||32|
|Redirecting an Outlook attachment to a specific folder?||3||46|
|How to get windows DNS resolve to internal address?||3||28|
|How to open form using item in Listbox.||8||21|