Major incidents and IT service outages cost companies millions. Often the solution to minimizing damage is automated communication. Find out more in our Major Incident Management Communications infographic.
Dim stUser As String = "" Dim iOtherCount As Integer = 0 Dim iSearch As Integer = 0 Dim stStage As String = "" Try 'Start Outlook. ' If it is already running, you'll use the same instance... Dim olApp As outlook.Application olApp = CreateObject("Outlook.Application") ' Logon. Doesn't hurt if you are already running and logged on... Dim olNs As outlook.NameSpace olNs = olApp.GetNamespace("MAPI") olNs.Logon() Dim folderContacts As outlook.MAPIFolder = olNs.GetDefaultFolder(outlook.OlDefaultFolders.olFolderContacts) Dim searchFolder As outlook.Items = folderContacts.Items Dim olItem As outlook.ContactItem Dim Updated As String = "" Dim counter As Integer = 0 For Each olItem In searchFolder If olItem.Class = outlook.OlObjectClass.olContact Then stUser = olItem.FullName If Not (olItem.OtherTelephoneNumber = Nothing) Then iOtherCount += 1 Add_Text(olItem.FullName & " - " & olItem.OtherTelephoneNumber, False) End If iSearch += 1 End If Next MsgBox("Complete: " & counter & " Searched: " & iSearch) Catch ex As Exception MsgBox(stStage & vbCrLf & ex.Message, MsgBoxStyle.Critical, "User Update: " & stUser & " Other Count = " & iOtherCount & " Searched: " & iSearch) Add_Text(ex.Message, True) End Try
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.