L
lostwings
I am writing a small program to respond to contact-Add event.
To obtain more usefule information, I used a custom contact form instead of
using the default the contact form to add contact. The custom contact form
contains an Text Control naming TextBox1. However, it seems I cannot
access this property. Following is the code snippet. I used the MsgBox to
capture the property. The default property FullName is captured very well.
Private WithEvents myContacts As Microsoft.Office.Interop.Outlook.Items
Private Sub myContacts_ItemAdd(ByVal Item As Object) Handles
myContacts.ItemAdd
Try
myItem = CType(Item, Microsoft.Office.Interop.Outlook.ContactItem)
MsgBox(myItem.FullName)
MsgBox(myItem.TextBox1)
Catch err As COMException
MsgBox("Exception in OnConnection: " & _
err.Message)
Catch err As InvalidCastException
MsgBox("Exception in OnConnection: " & _
err.Message)
End Try
End Sub
To obtain more usefule information, I used a custom contact form instead of
using the default the contact form to add contact. The custom contact form
contains an Text Control naming TextBox1. However, it seems I cannot
access this property. Following is the code snippet. I used the MsgBox to
capture the property. The default property FullName is captured very well.
Private WithEvents myContacts As Microsoft.Office.Interop.Outlook.Items
Private Sub myContacts_ItemAdd(ByVal Item As Object) Handles
myContacts.ItemAdd
Try
myItem = CType(Item, Microsoft.Office.Interop.Outlook.ContactItem)
MsgBox(myItem.FullName)
MsgBox(myItem.TextBox1)
Catch err As COMException
MsgBox("Exception in OnConnection: " & _
err.Message)
Catch err As InvalidCastException
MsgBox("Exception in OnConnection: " & _
err.Message)
End Try
End Sub