Getting recipients username from their display name in an appointm

From: nYssa (nYssa_at_discussions.microsoft.com)
Date: 11/01/04


Date: Sun, 31 Oct 2004 22:38:02 -0800

Hi,

I have a custom appointment form, and I am wanting to pop up a message if a
resource is invited to the appointment. I have the code to do this:

Function RecipCountNoResource()
        Dim objRecip
        Dim intCount
        Const olResource = 3
        intCount = 0
        Set colRecips = Item.Recipients
        For Each objRecip In Item.Recipients
                If objRecip.Type <> olResource Then
                        intCount = intCount + 1
                End If
        Next
        RecipCountNoResource = intCount
        Set objRecip = Nothing
End Function

HOWERVER: What I want to do is to check if the resource that is invited
belongs to a particular group. I have been told that the only way to do this
is creating a MAPI session in order to get the username. But I haven't been
able to find enough information to do it. Once I have the code to get the
username based on the recipient, then I can check if it is a particular
group, which I can do using the following code:

Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")

strDomain = "mydomain.com"
strUser = "nmillin"

Set oUser = GetObject("WinNT://" & strDomain & "/" & strUser)

If MemberOf("Solutions", oUser) = true then
     If objRecip
        intCount = intCount + 1
     End If
End If

However at the moment the user name is hard coded. So my question is again,
how do I get a recipients username (ie. jbloggs) using CDO/MAPI.



Relevant Pages

  • Getting recipients username from their display name
    ... I have a custom appointment outlook form, and I am wanting to pop up a ... message if a resource is invited to the appointment. ... is creating a MAPI session in order to get the username. ... Set objOutlook = CreateObject ...
    (microsoft.public.outlook.program_forms)
  • Re: Accessing a network share with a non-domain account
    ... call LogonUser with the NEW_CREDENTIAL option - you can pass in the username/password on the account on the target machine. ... Then impersonate and access the resource. ... The shared drive requires a username and password. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: IIS continually prompting users for their password
    ... > The user clicks on a link to a resource and is ... > prompted for their username and password, ... The continuous prompting simply says that something is misconfigured on your ... I set Basic Authentication at the Virtual Directory ...
    (microsoft.public.inetserver.iis.security)
  • Accessing share on WIn2k
    ... >32 drive on a system running Win2K. ... >computer running Windows XP and have a folder shared as ... For me to access any resource on the windows 2K ... I need to input a username and password if I ...
    (microsoft.public.win2000.security)
  • Re: Verifying existence of a mailbox for a given username
    ... I am not given the first name, only the username. ... appointments in an Exchange store. ... Should I simply try to open the HTTP resource (e.g. ... Programmer/Analyst ...
    (microsoft.public.exchange.development)