Click to See Complete Forum and Search --> : New filed in outllok


latha_71
April 23rd, 2001, 12:52 PM
Hi,
I would like to add a new filed under the default contact folder of outlook. How do I do this thru VB?

any help will be greatly appreciated.
Thanks
Latha

latha_71
April 24th, 2001, 06:58 PM
Atlast I found a way of creating new field in the contact folder of outlook.The new field is getting displayed under the user-defined fields.

But when I select the contact folder....The newly added field is not getting displayed in the ListView. why?. How do I make it display in the listview?

The following code adds the new field.

Private Sub Form_Load()
Dim ol As Object
Dim olns As Object
Dim objAllContacts As Object
Dim Contact As Object
Dim Prop As Outlook.UserProperty
Dim objFolder As Outlook.MAPIFolder

Set ol = New Outlook.Application
Set olns = ol.GetNamespace("MAPI")
Set objFolder = olns.GetDefaultFolder(olFolderContacts)
Set objAllContacts = objFolder.Items
For Each Contact In objAllContacts
Set Prop = Contact.UserProperties.Add("edf", olText)
Prop.Value = "yes"
Contact.Close (olSave)
Next
End Sub
Thanks
Latha

latha_71
April 24th, 2001, 07:41 PM
sorry... the subject is Newfield in outlook.
--Latha