Getting recipients username from their display name in an appointm
From: nYssa (nYssa_at_discussions.microsoft.com)
Date: 11/01/04
- Next message: Haim: "Outlook 2003 through VB.NET"
- Previous message: Ervin: "Add new PropertyPages with new tab"
- Next in thread: Tom Rizzo [MSFT]: "Re: Getting recipients username from their display name in an appointm"
- Reply: Tom Rizzo [MSFT]: "Re: Getting recipients username from their display name in an appointm"
- Reply: nYssa: "RE: Getting recipients username from their display name in an appointm"
- Messages sorted by: [ date ] [ thread ]
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.
- Next message: Haim: "Outlook 2003 through VB.NET"
- Previous message: Ervin: "Add new PropertyPages with new tab"
- Next in thread: Tom Rizzo [MSFT]: "Re: Getting recipients username from their display name in an appointm"
- Reply: Tom Rizzo [MSFT]: "Re: Getting recipients username from their display name in an appointm"
- Reply: nYssa: "RE: Getting recipients username from their display name in an appointm"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|