G
Guest
Hello and Thanks for the Help in Advance
I am trying to open a contact item using a button on a VB.Net toolbar. This was pretty straight foward in VB6 but I am having trouble getting to the Public Folder where the contacts are stored
Any Help would be apprecaited!!
Here is the code I have. I am getting the Contact name from a sql server.
Dim conSql As New SqlClient.SqlConnectio
conSql.ConnectionString = "Integrated Security = True;" &
"Data Source = *****;Initial Catalog = *****;
Dim cmd As New SqlClient.SqlComman
cmd.Connection = conSq
cmd.CommandType = CommandType.Tex
cmd.CommandText = "Select TWCUSTOM.dbo.fn_TW_GetContractor()
conSql.Open(
Dim ContractorName = cmd.ExecuteScalar(
conSql.Close(
' Set the application objec
Dim ol As Outlook.Applicatio
Dim oNS As Outlook.NameSpac
oNS = ol.GetNamespace("MAPI"
' Set the namespace objec
Dim myFolder As Outlook.MAPIFolde
Dim myFolder1 As Outlook.MAPIFolder = oNS.Session.Folders("Public Folders"
Dim myFolder2 As Outlook.MAPIFolder = myFolder1.Folders("All Public Folders"
Dim MyFolder3 As Outlook.MAPIFolder = myFolder2.Folders("Public Contacts"
Dim MyItems = MyFolder3.Item
Dim MYClause = "[CompanyName] =" & ContractorName & " And [Full Name] =" & "'" & ContractorName & "'
Dim MyContactsItems = MyItems.Restrict(MYClause
For Each MyItems In MyContactsItem
MyItems.Display(
Nex
I am trying to open a contact item using a button on a VB.Net toolbar. This was pretty straight foward in VB6 but I am having trouble getting to the Public Folder where the contacts are stored
Any Help would be apprecaited!!
Here is the code I have. I am getting the Contact name from a sql server.
Dim conSql As New SqlClient.SqlConnectio
conSql.ConnectionString = "Integrated Security = True;" &
"Data Source = *****;Initial Catalog = *****;
Dim cmd As New SqlClient.SqlComman
cmd.Connection = conSq
cmd.CommandType = CommandType.Tex
cmd.CommandText = "Select TWCUSTOM.dbo.fn_TW_GetContractor()
conSql.Open(
Dim ContractorName = cmd.ExecuteScalar(
conSql.Close(
' Set the application objec
Dim ol As Outlook.Applicatio
Dim oNS As Outlook.NameSpac
oNS = ol.GetNamespace("MAPI"
' Set the namespace objec
Dim myFolder As Outlook.MAPIFolde
Dim myFolder1 As Outlook.MAPIFolder = oNS.Session.Folders("Public Folders"
Dim myFolder2 As Outlook.MAPIFolder = myFolder1.Folders("All Public Folders"
Dim MyFolder3 As Outlook.MAPIFolder = myFolder2.Folders("Public Contacts"
Dim MyItems = MyFolder3.Item
Dim MYClause = "[CompanyName] =" & ContractorName & " And [Full Name] =" & "'" & ContractorName & "'
Dim MyContactsItems = MyItems.Restrict(MYClause
For Each MyItems In MyContactsItem
MyItems.Display(
Nex