CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2001
    Location
    California, U.S.A
    Posts
    21

    New filed in outllok

    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


  2. #2
    Join Date
    Jan 2001
    Location
    California, U.S.A
    Posts
    21

    Re: New filed in outllok

    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


  3. #3
    Join Date
    Jan 2001
    Location
    California, U.S.A
    Posts
    21

    Re: New filed in outllok

    sorry... the subject is Newfield in outlook.
    --Latha


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured