Share via


Outlook Address book integration (SAMPLE)

This is a very simple sample how you could reuse MsSvAbw.AddrBookWrapper to populate a text field with chosen outlook user(s) from the address book. The idée is to reuse a dll found in Windows Sharepoint Server (2003) called MSOVABW.dll and script code. This could be extended to be used in many different business scenarios..

<html>

<head>

    <title>Lookup
Outlook Address book</title>

    <script language="VBScript">

        function
AddrBookVB(strExist)

              Dim Users1

              Dim t

              Dim s1

              Dim item

              L_MsAddrBook_TXT
= "Title: Microsoft Address Book"

              On Error Resume Next

           

              Set t = CreateObject("MsSvAbw.AddrBookWrapper")

              if Err <> 0 then

                    Err.Clear

                    set t =
CreateObject("MsoSvAbw.AddrBookWrapper")

              end if

              if not IsObject(t) then

                    MsgBox "Error object not found.."

                    AddrBookVB
= ""

              else

                   
t.AddressBook L_MsAddrBook_TXT & "",
1, "", "",
"", Users1

                    For each item in Users1

                       strExist
= item.SMTPAddress

                    Next

                    Set t = Nothing

                    AddrBookVB
= strExist

              end if

        End function

    </script>

</head>

<body marginwidth="0" marginheight="0" scroll="yes">

    <form name="crmForm" method="post">

        <table cellpadding="0" cellspacing="2" border="0">

            <tr>

                <td>

                    <textarea name="users" rows="5" cols="64" class="ms-long" title="Add users text field"></textarea><br>

                </td>

            </tr>

            <tr>

                <td>

                    <input type=button value='Lookup Outlook Address Book' id='AddrBookID' onclick='document.crmForm.all.users.value
= AddrBookVB(null)' />

                </td>

            </tr>

        </table>

    </form>

</body>

</html>