Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Greetings,

 

I currently have a billing system completed which stores all the contacts in a DB table, and I'm trying to let lose my ties with the DB a little more and move to exchange. I'd like to store my contacts in a exchange public folder, but I'm having problems accessing this (what seems to be) dark corner.

 

I've first attempted via LDAP, which of course failed since I later read that you have no access to specific items in Exchange through this method. My next attempt was though CDO.DLL and MAPI. From what I've read, this may be my solution, but cannot find any resources available to help me (or the search key words may just be eluding me at the current time =P ).

 

My Q is, does anyone have any experience with this and can point me in the right direction, or know of any reading material on the net (or in hard book form, I don't care at this point)?? I'd greatly appreciate any help I can get with this topic as it'd open many doors for me in what I'm trying to accomplish.

 

Thanks in advance!

~~ The One Who Was ~~
Posted

PlausiblyDamp

 

We would like to target exchange 2K3 standard. But we are currently running 2K. It's up in the air still as to what we will have exactly when (if) I get this working.

 

I've almost succeeded using a references to the MS Outlook 10 COM object, however, I'm fighting with the popup authorization from then Office SP2 security patch. I'd have thought MS would be a little more friendly to their developers when writing software that integrates with their products. We are after all purchasing their products in the first place :D

~~ The One Who Was ~~
Posted

Greetings,

 

Well, I've kinda hit another wall. I've managed to get past most of my problems. I'm sorta stuck with these security popups, but I've found out that if I do not retrieve the e-mail address from the contact item, outlook won't pop up a security message.

 

The following code I've pulled outta the MSDN site with a lot of digging. I've modified it a bit so that it will ask you which folder to view contacts from. I hope this can be of assistance to someone out there.

 

The following requires you to add a reference to Outlook under the COM folder:

 

      Dim oApp As Outlook.Application = New Outlook.Application()

       [color=Lime]' Get NameSpace and Logon.[/color]        
       Dim oNS As Outlook.NameSpace = oApp.GetNamespace("mapi")
       oNS.Logon("", "", False, True)

       [color=Lime]' Get the first contact from the Contacts folder.[/color]        [color=Lime]'The following line chooses the users personal contacts, which I wasn't wanting to do, so I created
       'a folder picker that is nicely placed in the outlook10 control.
       'Dim cContactsOld as Outlook.MAPIFolder = ons.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts)[/color]
       Dim cContacts As Outlook.MAPIFolder = oNS.PickFolder

       Dim oItems As Outlook.Items = cContacts.Items
       Dim oCt As Outlook.ContactItem

       Try

           oCt = oItems.Add

           txtResults.Text &= oCt.FullName & Environment.NewLine
           txtResults.Text &= oCt.CompanyName & Environment.NewLine
           txtResults.Text &= oCt.BusinessHomePage & Environment.NewLine
           txtResults.Text &= oCt.MailingAddress & Environment.NewLine
           txtResults.Text &= oCt.BusinessAddress & Environment.NewLine
           txtResults.Text &= oCt.Categories & Environment.NewLine

       Catch

           Console.WriteLine("an error occurred")

       Finally

[color=Lime]            ' Display[/color]
[color=Lime]            'This next line displays a edit box for the selected contact'[/color]
           oCt.Display(True)

[color=Lime]            ' Log off.[/color]
           oNS.Logoff()

[color=Lime]            ' Clean up.[/color]
           oApp = Nothing
           oNS = Nothing
           oItems = Nothing
           oCt = Nothing

       End Try

 

If anyone has successfully pulled an e-mail address outta the contacts list (without raising security flags on office XP SP2) I'd be very glad to hear how you did so.

~~ The One Who Was ~~

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...