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..

< lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A31515;
mso-ansi-language:EN-US;mso-no-proof:yes'>html style='font-size:10.0pt;font-family:"Courier New";color:blue;mso-ansi-language:
EN-US;mso-no-proof:yes'>>

< lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A31515;
mso-ansi-language:EN-US;mso-no-proof:yes'>head style='font-size:10.0pt;font-family:"Courier New";color:blue;mso-ansi-language:
EN-US;mso-no-proof:yes'>>

style='mso-spacerun:yes'>    < style='color:#A31515'>title>Lookup
Outlook Address book</ style='color:#A31515'>title>

style='mso-spacerun:yes'>    < style='color:#A31515'>script language style='color:blue'>="VBScript">

style='mso-spacerun:yes'>        function
AddrBookVB(strExist)

              style='color:blue'>Dim Users1

              style='color:blue'>Dim t

              style='color:blue'>Dim s1

              style='color:blue'>Dim item

              L_MsAddrBook_TXT
= "Title: Microsoft Address Book"

              style='color:blue'>On Error style='color:blue'>Resume Next

style='mso-spacerun:yes'>           

              style='color:blue'>Set t = CreateObject("MsSvAbw.AddrBookWrapper")

              style='color:blue'>if Err <> 0 then

                    Err.Clear

            style='mso-spacerun:yes'>        set t =
CreateObject("MsoSvAbw.AddrBookWrapper")

              style='color:blue'>end if

              style='color:blue'>if not IsObject(t) style='color:blue'>then

                    MsgBox style='color:#A31515'>"Error object not found.."

                    AddrBookVB
= ""

              style='color:blue'>else

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

                    style='color:blue'>For each item style='color:blue'>in Users1

                       strExist
= item.SMTPAddress

                    style='color:blue'>Next

                    style='color:blue'>Set t = Nothing

                    AddrBookVB
= strExist

              style='color:blue'>end if

style='mso-spacerun:yes'>        End style='color:blue'>function

style='mso-spacerun:yes'>    </ style='color:#A31515'>script>

 

</ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A31515;
mso-ansi-language:EN-US;mso-no-proof:yes'>head style='font-size:10.0pt;font-family:"Courier New";color:blue;mso-ansi-language:
EN-US;mso-no-proof:yes'>>

< lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A31515;
mso-ansi-language:EN-US;mso-no-proof:yes'>body style='font-size:10.0pt;font-family:"Courier New";mso-ansi-language:EN-US;
mso-no-proof:yes'> marginwidth style='color:blue'>="0"
marginheight style='color:blue'>="0" scroll style='color:blue'>="yes">

style='mso-spacerun:yes'>    < style='color:#A31515'>form name style='color:blue'>="crmForm" method style='color:blue'>="post">

style='mso-spacerun:yes'>        < style='color:#A31515'>table cellpadding style='color:blue'>="0" cellspacing style='color:blue'>="2" border style='color:blue'>="0">

style='mso-spacerun:yes'>            < style='color:#A31515'>tr>

style='mso-spacerun:yes'>                < style='color:#A31515'>td>

style='mso-spacerun:yes'>                    < style='color:#A31515'>textarea name style='color:blue'>="users" rows style='color:blue'>="5" cols style='color:blue'>="64" class style='color:blue'>="ms-long" title style='color:blue'>="Add users text field"></ style='color:#A31515'>textarea>< style='color:#A31515'>br>

style='mso-spacerun:yes'>                </ style='color:#A31515'>td>

style='mso-spacerun:yes'>            </ style='color:#A31515'>tr>

style='mso-spacerun:yes'>            < style='color:#A31515'>tr>

style='mso-spacerun:yes'>                < style='color:#A31515'>td>

                    style='mso-spacerun:yes'> < style='color:#A31515'>input type style='color:blue'>=button value style='color:blue'>='Lookup Outlook Address Book' style='color:red'>id='AddrBookID' style='color:red'>onclick='document.crmForm.all.users.value
= AddrBookVB(null)'
/>

style='mso-spacerun:yes'>                </ style='color:#A31515'>td>

style='mso-spacerun:yes'>            </ style='color:#A31515'>tr>

style='mso-spacerun:yes'>        </ style='color:#A31515'>table>

style='mso-spacerun:yes'>    </ style='color:#A31515'>form>

</ lang=EN-US style='font-size:10.0pt;font-family:"Courier New";color:#A31515;
mso-ansi-language:EN-US;mso-no-proof:yes'>body style='font-size:10.0pt;font-family:"Courier New";color:blue;mso-ansi-language:
EN-US;mso-no-proof:yes'>>

</html style='font-size:10.0pt;font-family:"Courier New";color:blue;mso-no-proof:yes'>>

 

Comments (0)

Skip to main content