Code for the topic :E_ACCESSDENIED error when logging into a CDO session to access Global Address Book{Global Address List}

Hi,
  Please find the code am trying.
Regards,
deepak

<html>
<head>
<meta name="GENERATOR" content="YesSoftware CodeCharge v.2.0.3 /
Templates.ccp build 10/17/2001">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"><link rel="stylesheet" href="Site.css"
type="text/css">
<link rel="stylesheet" href="Footer.css" type="text/css"></head>
<script src="GlobalAddressBook.vbs" language="VBScript"
type="text/vbscript"></script>
<body class="PageBODY">
 <table>
  <tr>
   <td valign="top">
   <!--BeginFormUser-->
   <form method="POST" action="{FileName}" name="User">
    <table class="FormTABLE">

<!--
  <tr>
      <td class="FieldCaptionTD"><font
class="FieldCaptionFONT">Login</font></td>
      <td class="DataTD"><input type="text" name="login" maxlength="15"
value="{login}" size="15"></td>
     </tr>

     <tr>
      <td class="FieldCaptionTD"><font
class="FieldCaptionFONT">Password</font></td>
      <td class="DataTD"><input type="password" name="pass"
maxlength="15" value="{pass}" size="15"></td>
     </tr>
-->

     <tr>
      <td class="FieldCaptionTD"><font
class="FieldCaptionFONT">Name</font></td>
      <td class="DataTD"><input type="text" name="user_name"
maxlength="30" value="{user_name}" size="18">
   <input type="submit" name="globalAddressBook" value="Browse"
value="Click">
    <SCRIPT FOR="globalAddressBook" EVENT="onClick"
LANGUAGE="VBScript">
    'For all the API for programming with Outlook
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cdo/html/591200b7-e0d4-408d-b0f1-2fca07c5a4e6.asp
    Const cdoE_USER_CANCEL = &H80040113
    ' start CDO session
    Set objSession = CreateObject("MAPI.Session")
    Call objSession.Logon ("Outlook")
    On Error Resume Next
    Set colCDORecips = objSession.AddressBook(, _
                       "Pick a Name", , , 1, _
                       "My Choice") 'Returns a Reciepients Collection
Object
    If Err = 0 Then
        If colCDORecips.Count <> 1 Then
            MsgBox "Please choose exactly 1 name.", , _
                "Chose One Name"
        Else
   Set recepObject = colCDORecips.Item(1) 'Returns an object of type
Recepient
   isPDL = recepObject.AddressEntry.DisplayType 'Returns the type of
the reciepient address
    If isPDL = 1 then 'DisplayType is set to CdoDistList{1} so its a
Public Distribution List
     Set objAddrEntriesColl = recepObject.AddressEntry.Members 'Returns
a collection which has all the members
     numberOfMembers = objAddrEntriesColl.Count 'Gets the count
     For i=1 to numberOfMembers
      Set addressEntryObject = objAddrEntriesColl.Item(i) 'Each is a
address entry object
       For each objField in addressEntryObject.Fields
        If (instr(objField.value,"@domain.com")) Then
         Set mailId = objField.value
         MsgBox "Correct Mail-id:" &objField.value
        End If
       Next
     Next
    ElseIf isPDL = 0 then 'DisplayType is set to CdoUser{0} so its a
Its local messenging user
     Set addressEntryObj = colCDORecips.Item(1).AddressEntry
     address = addressEntryObj.Address

     'MsgBox "The Entry selected is :"
&colCDORecips.Item(1).AddressEntry.Address
      For each objField in addressEntryObj.Fields
       If (instr(objField.value,"@domain.com")) Then
        Set mailId = objField.value
        MsgBox "Correct Mail-id:" &objField.value
       End If
      Next
    Else
     MsgBox "The selected entry is either not a local user/Public
Distribution List {PDL}. "
    End if
            If Err = 287 Then
                ' security block triggered
                MsgBox "Outlook cannot return " & _
                       "a name, because " & _
                       "you clicked No on the " & _
                       "e-mail address access " & _
                       "dialog. You need to try " & _
                       "again and click Yes " & _
                       "this time.", , _
                       "E-mail Address Access"
            End If
        End If
    ElseIf Err = cdoE_USER_CANCEL Then
            ' user canceled the address book dialog -
            ' do nothing or provide a message to user
    End If
    ' release objects
    objSession.Logoff
    Set colCDORecips = Nothing
    Set objSession = Nothing
    </SCRIPT>
   </td>

     </tr>
     <tr>
      <td class="FieldCaptionTD"><font
class="FieldCaptionFONT">Email</font></td>
      <td class="DataTD"><input type="text" name="email" maxlength="30"
value="{email}" size="30"></td>
     </tr>


     <tr>
      <td colspan="2" align="right">
      <!-- ***   Buttons   *** -->

      <!--BeginUserInsert-->
      <input type="hidden" value="insert" name="FormAction">
      <input type="submit" value="Add"
onclick="document.User.FormAction.value = 'insert';">
      <!--EndUserInsert-->

      <!--BeginUserEdit-->
      <input type="hidden" value="update" name="FormAction"/>

      <!--BeginUserUpdate-->
      <input type="submit" value="Update"
onclick="document.User.FormAction.value = 'update';"/>
      <!--EndUserUpdate-->

      <!--BeginUserDelete-->
      <input type="submit" value="Delete"
onclick="document.User.FormAction.value = 'delete';"/>
      <!--EndUserDelete-->

      <!--EndUserEdit-->

      <input type="hidden" name="FormName" value="User"/>

      <input type="hidden" name="PK_user_id" value="{PK_user_id}"/>
      <input type="hidden" name="user_id" value="{user_id}"/>
     </td>
    </tr>
   </table>
  </form>
<!--EndFormUser-->
   <SCRIPT Language="JavaScript">
if (document.forms["User"])
document.User.onsubmit=delconf;
function delconf() {
if (document.User.FormAction.value == 'delete')
  return confirm('Delete record?');
}
</SCRIPT>
   </td>
  </tr>
 </table>


</body>
</html>

0
deepujain (2)
9/19/2005 11:55:44 AM
outlook 87535 articles. 11 followers. Follow

0 Replies
422 Views

Similar Articles

[PageSpeed] 57

Reply:

Similar Artilces:

Reporting from Project Server
I dont know if i need to ask this question here or in the Access section. I have an ODBC connection to the Project Server database so I can make reports through Access. Access' limit of 255 fields per table is causing me some trouble. for example, the MSP_VIEW_PROJ_PROJECTS_ENT table has well over 255 fields. Access only shows me the first 255 fields. how can I change that so I can see all the fields in that table? thanks, Hadi Hadi, I have not tried this yet it may be a viable option. Have your DBA create a view that pulls the key fields to this table and the specifi...

Outlook 0x800ccc0d error when Norton e-mail protect enabled: see hosts
This post is made to help others solve this issue, based on my experience. Symptom: - Outlook works perfectly well when Norton Anti-Virus e-mail protection is disabled - Outlook cannot retrieve incoming messages when NAV e-mail protection is enabled, message being: pop3 server not found, error 0x800ccc0d This symptom, and possible solutions, are exactly the object of Symantec support note: http://service1.symantec.com/SUPPORT/nav.nsf/docid/2000020716064206 Please read this note first ! The object of this post is to add another possible solution to this problem. NAV email protection sets up...

find action on log file
Hello there I want to use outside tool to find who made some update on table in my server I know that there are many tools for this. But can they do it on simple recovery model? Roy Goldhammer (royg@yahoo.com) writes: > I want to use outside tool to find who made some update on table in my > server > > I know that there are many tools for this. But can they do it on simple > recovery model? No. If you are using the simple recovery model, the contents of the log is wasted away everyonce in a while. Well, if the disk area has not been overwritten...

invalid email address
In message to Candy FH Muffman wrote of having an invalid email address. I use hotmail but would like to prevent ti being used by spammers. Is there any way I can hide it or restrict it in some way? Can I make it invalid? Thank you You mean when posting to an online service like this? Sure, don't type your (correct) email address. See my address or from many others to see an example. Note: I've removed your valid address in my reply. -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add...

Unknown error from CFtpConnection::GetFile()...
Hi all, I'm having intermittent problems with CFtpConnection::GetFile()... 99% of the time GetFile() succeeds but occasionally it fails and returns FALSE with a GetLastError of 0x2EFF (12031) which I can't find documented/defined anywhere... Anyone know what this error means...? Where it is defined...? A bit of searching on on the web seems to suggest; "The connection with the server has been reset." Can anyone confirm this...? Many thanks, Andy. Andrew Kilgore wrote: > Hi all, > > I'm having intermittent problems with CFtpConnection::GetFile()... > 99%...

Error 550 Relaying denied
I get this nearly every time I try to send information using MS Outlook email. Any suggestions? You probably need to turn on authentication to your outgoing server. You can do so on the "Outgoing Server" tab for your mail account. -- Jocelyn Fiorello MVP - Outlook *** Messages sent to my e-mail address will NOT be answered -- please reply only to the newsgroup to preserve the message thread. *** In news:9cf101c3eacf$a3250cb0$a401280a@phx.gbl, Dick Brenneke wrote: > I get this nearly every time I try to send information > using MS Outlook email. Any suggestions? Th...

contact list #13
Good Day, I hope I am in the right area, we are running Exchange 2003 one Server 2003 and have Outlook 03 clients. We have address lists in the public folder an admin and a vendor, these contain contact information on contrators and vendors. In the folder list I can browse down and few and click on a contact to send them an email, but when I open a new email to send and I click on to and what to chose the list from the address book drop down box they are not there. How do I set it up so vendors and Admin contact list appear in the drop down box in the contact list? Thank you David ...

explanation of codes in Visual Basic when creating User form
Hi, I am trying to create a user form in Visual Basic however I'm trying to teach myself by reading/watching tutorials. (www.contectures.o.ca, etc) A lot of the instructions I am seeing simply give the code rather than explain how to actually write one from scratch. So... I need to know what each 'term' means so I can understand how the codes work. Any help is much appreciated :) One of the first codes is for the Add button Private Sub cmdAdd_Click() Dim iRow As Long Dim ws As Worksheet Set ws = Worksheets("PartsData") What d...

how to find an item in a list control?
hi all, In a list Control how to find an item. If it is found then the item should be highlighted. how to do this? i wrote the following code but its not working what's wrong in the code? LVFINDINFO info; int nIndex; info.flags = LVFI_PARTIAL|LVFI_STRING; info.psz = (LPCTSTR) str; //fd.m_strEditCtrl; sprintf(st,"%d",m_ListCtrl.GetItemCount()); MessageBox(st,"Count"); for(int i=0;i < m_ListCtrl.GetItemCount();i++) { if((nIndex = m_ListCtrl.FindItem(&info,-1)) == -1 ) { m_ListCtrl.SetItemState(nIndex,LVIS_SELECTED,LVIS_SELECTED); } } thanks and r...

CSV Files and VLOOKUP error
Does anyone know why VLOOKUP and Compare formulas don't work o information originating from a CSV file? I've tried copying an pasting values only (to leave behind any formatting), but it doesn' help. Through countless tests, I've narrowed it down to the CSV file bein the only possible cause -- Message posted from http://www.ExcelForum.com Hi ajpowers, Just a guess but the imported data may have leading or trailing spaces or are numbers stored as text. You could use the formula =A1=D1 to see if you get a true or false, where A1 is the lookup value and D1 ia the CVS valu...

Document Viewer installer error
I recently ran CHKDSK /F as this was prompted when I attempted to run defrag etc. Since the chkdsk was run, when I turn my PC on, I receive the following message: "document viewier - installed encountered an unexpected error - error code 2908". I click run, the same error just repeats and loops. The only was I can remove it is to end task via task manager. Any ideas how I can correct this error? many thanks ...

Uninstall of mappoint has caused errors with excel
Hi, I am running Office 2003 on the terminal server (windows 2003) and had a copy of mappoint as well. This is a mapping program. We ininstalled mappoint which has caused an error message with Excel and other office products. The error says "Cd:\documents and settings\administrator.ocrdc1\application data\microsoft\addins c:\Program files\common files\microsoft shared\geography\mpoai9.dll is not a valid add-in." I then click OK and excel opens up and everything is fine. The problem is that we are using other programs as well such as Quickbooks that export to excel and t...

Cannot open Outlook, keep getting Send error report of Microsoft.
We are having problems with Outlook 2003. Everytime we try to open, we get this: Send error report to Microsoft. Any ideas why? All windows and office update have been completed. ...

Error 130
Hope someone can point me in the right direction. OSX 10.63, MacOffice 2008 12.2.4 When I try to connect to the following news server ( that doesn't require a user name or password ) I get the following error when attempting to download the List of Newsgroups: "Too many connections in your class - Could not receive the Newsgroup List - ERROR 130 " Any pointers much appreciated. Using Msnews servers works fine. -- Welsh Gas Remove usual to reply direct. paulatwoodsforddotcodotuk On 4/27/10 10:49 PM, in article 59bb7979.-1@webcrossing.JaKIaxP2ac0, "We...

Access to User Calendar
I have a user called small conference room that is used to schedule meetings on its calendar. I would like to link the calendar from our intranet site to the calendar with a UNC path. I am calling outlook: and I can get to my local mailbox and public folders but I am unable to connect to another users calendar. I am running Exchange 2003 and Outlook 2003. Is there some security modifications that need to be done? Any help is appreciated. Thanks, Steve I believe that you will need full mailbox rights. -- Ed Crowley MVP - Exchange "Protecting the world from PSTs and brick backups!&...

how do I add error bars to a 3D chart in excel?
The help states you can only add error bars to data series in 2D area. Is there a way to add them to a 3D chart? Hi, I would not have thought so. Obviously as it is not a built-in option the only way would be a work around perhaps using dummy series. Unfortunately you can create 3d combination charts. Stick with the 2d view. Cheers Andy elahe wrote: > The help states you can only add error bars to data series in 2D area. Is > there a way to add them to a 3D chart? -- Andy Pope, Microsoft MVP - Excel http://www.andypope.info I checked, and error bars are not offered for 3D ch...

microsoft.public.access.conversion
...

ERROR: 5.1.2 or other punctuation after the recipient's email address.
I am trying to send a email to a group address I created with 58 addresses in it. When I try to send the email to this group I get the following Error: "5.1.2 or other punctuation after the recipient's email address. " I have gone back to the original contact cards and made sure the addresses were all legal. I have re-created the list, same problem I have re-booted, same thing. Any thoughts out there? Thanks Dunc My wife and I have MBP's and are both running MS Office for Mac's, Entourage 12.2.3. Both of us have messages cued up in the out boxes th...

I cannot get Outlook to send/receive. Error says object not found
I just installed Outlook2007. I cannot get the send/receive to work. That is when the error says Object not found. If I go to accounts and properties, I run the two tests and they complete fine. What should I try next? Outlook 2007 is the only new program, all the rest are from Office 2003 IMK <IMK@discussions.microsoft.com> wrote: > I just installed Outlook2007. I cannot get the send/receive to work. > That is when the error says Object not found. If I go to accounts and > properties, I run the two tests and they complete fine. What should I > try next? Outlook 2007 is ...

How to set "licence" for Access 2007 database?
Hi I developed an Access 2007 db to a client. Now I want to make a year based licence for that database that the client must pay if they want to continue using the database after year. It must be so that database cannot be used after this date. How I can accomplish this? Thanks! On Mon, 12 Apr 2010 13:14:17 -0700 (PDT), Sandroid <santeri.virtanen@gmail.com> wrote: >Hi > >I developed an Access 2007 db to a client. Now I want to make a year >based licence for that database that the client must pay if they want >to continue using the database after year. It mu...

Sent emails not logged in Sent Items (Outlook 2010)
I am using the Beta version of Outlook 2010 with Windows 7 Pro (64 bit). Sent emails are not logged in the Sent Items folder nor do saved drafts appear in the Drafts folder. I have confirmed that the relevant settings are checked in the Mail Settings. Any ideas what I can do to solve this problem? -- Stephen Newton "snewton" <snewton@discussions.microsoft.com> wrote in message news:F7345EA6-9E42-4DF7-AFA5-AD2DF2CA840D@microsoft.com... >I am using the Beta version of Outlook 2010 with Windows 7 Pro (64 bit). > Sent emails are not logged in the Sent I...

Problem with different versions of Access
Hello, I am working on a VBA Access pplication which connects to a SQL Server database. I have a continuous form displayed with data, ad it is linked to a database table, so when I enter a value from my form the data in instantaneously updated in the database. The problem I have is that this form works perfectly when I am developping, and using my developpement environement (with Access allowing me to set breakpoints, go step by step in the code and so on), but it does not work when I use it in the PC of the ending user : in this case, when I enter a value in the form, and click in a...

Automatically Add Address to Contacts
This feature was available in OL2000 when you replied to someone. Can this be done in OL2003? -- John Harris (Harry) Computer Troubleshooters - Hornby Christchurch New Zealand No version of Outlook had this feature except Outlook 98/2000 in IMO mode. You'd have to create a feature like this with code: http://www.outlookcode.com/d/code/autoaddrecip.htm -- Russ Valentine [MVP-Outlook] "John Harris" <johnh@antispam.comptroub.co.nz> wrote in message news:ueDWZH8mEHA.592@TK2MSFTNGP11.phx.gbl... > This feature was available in OL2000 when you replied to someone. ...

Changing Domain Name through Internet Address Management Wizard
Hi Guys I know its weekend. but i need to post for peace of mind. I have a client using SBS 2008 STD.He isusing remote.mydomain.com address through Internet address management wizard. Now he wants to change to remote.mynewdomain.com as old domain is too long. Is there any way so we can change through IAMW. run the wiz, job done. "Atul Sood" <atulsood@live.com> wrote in message news:uVlbmkd3KHA.4028@TK2MSFTNGP05.phx.gbl... > Hi Guys > > I know its weekend. but i need to post for peace of mind. I have a client > using SBS 2008 STD.He isusing rem...

Remote humans can't get email addressed to them from within the do
I call them remote humans because they are not "users" set up on the SBS2003 system. I've set up a local domain, call it domain.local, and the email domain is domain.org. For all internal users, there is no problem. But there are two people, out of state, with email addresses user1@domain.org and user2@domain.org. Our email is hosted, and we use the POP3 connector to bring it into our Exchange server. We do not use POP3 connector for the remote humans - their Outlook client has the POP3 account set up on it. These remotes will never connect to the local domain, all th...