URGENT!!!!!!!!!!!!!!!!! Accessing MS Outlook Address book using asp.net

Discussion in 'ASP .Net' started by Guest, Nov 19, 2003.

  1. Guest

    Guest Guest

    Hi

    I have a webform in whihc ther is button . when i click on
    button i am displaying all the email address in the
    outlook. it is working fine when i try to acess webpage in
    mycomputer.

    Private Sub CallOutlookAddressBook()
    Dim OLApp As New Outlook.Application()
    'Creating Outlook Namespace object to Access MAPI
    name space
    Dim OLNameSpace As Outlook.NameSpace
    'Declaring variable to access MAPIFOLDER
    Dim allcontacts As Outlook.MAPIFolder
    '
    OLNameSpace = OLApp.GetNamespace("MAPI")
    'Getting outlook contacts folder and setting up
    reference to allcontacts
    allcontacts = OLNameSpace.GetDefaultFolder
    (Outlook.OlDefaultFolders.olFolderContacts)
    'sorting the contacts by company name
    allcontacts.Items.Sort("Email1Address")
    'creating contact variable item for iteration
    Dim contact As Outlook.ContactItem
    'count
    Dim cnt As Integer
    'Iterating to the allcontacts items collection
    For cnt = 1 To allcontacts.Items.Count
    contact = allcontacts.Items.Item(cnt)
    'if company name is not empty then write
    company name on console.
    'later on you cna load the companynames to a
    listbox or listview.
    If cnt > 10 Then
    Exit For
    End If
    If contact.Email1Address <> "" Then
    'writing the company name to console
    'Console.WriteLine(contact.Email1Address)
    lblMessage.Text = lblMessage.Text & "," &
    contact.Email1Address
    End If
    Next
    End Sub

    1)WHen i install this application in different system and
    run the webpage it gives me error at this line.

    "Dim OLNameSpace As Outlook.NameSpace"

    2)and when i try to access this webpage from different
    computer with out installing it give me an error

    " custom errors = off"

    can anyone know what it is and why i am geting this error
    and any solutions to those

    Thanks in advance
    sireesha

    ..
    Guest, Nov 19, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alex Cahn

    Accessing a asp.net page from outlook

    Alex Cahn, Jul 28, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    385
    Alex Cahn
    Jul 28, 2003
  2. Ashish
    Replies:
    0
    Views:
    373
    Ashish
    Jun 17, 2005
  3. Murthy
    Replies:
    0
    Views:
    822
    Murthy
    Feb 21, 2005
  4. Replies:
    4
    Views:
    1,464
Loading...

Share This Page