A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Check whether an user(account) is delegated to send mail on behalf



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 21st 09, 07:38 AM posted to microsoft.public.outlook.program_vba
Kalyan
external usenet poster
 
Posts: 8
Default Check whether an user(account) is delegated to send mail on behalf

I need to programmatically check whether an user(account) is delegated to
"send mail on behalf of somebody" else. I'm referring to this feature in
outlook, in the outlook menu "Tools"--"Options.."-- "Delegates" tab.

I can't able to figure out from VBA programming API. Could anybody pls help
to figure out this with VB/vbscript code?
Ads
  #2  
Old January 21st 09, 03:56 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Check whether an user(account) is delegated to send mail on behalf

That's not available in the Outlook object model. You can read the folder
permissions using a lower level API such as CDO 1.21 or Redemption
(www.dimastr.com/redemption) or Extended MAPI (C++ or Delphi only).

Here's an example of reading folder permissions using CDO 1.21 (optional
installation for Outlook and mostly deprecated now):
http://www.cdolive.com/aclviewer.htm.

You can do similar things using those other API's. If you are using Outlook
2007 you could use similar code using Folder.PropertyAccessor to read the
ACL's. Of course then you'd need to interpret the data you get back.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Kalyan" wrote in message
...
I need to programmatically check whether an user(account) is delegated to
"send mail on behalf of somebody" else. I'm referring to this feature in
outlook, in the outlook menu "Tools"--"Options.."-- "Delegates" tab.

I can't able to figure out from VBA programming API. Could anybody pls
help
to figure out this with VB/vbscript code?


  #3  
Old January 21st 09, 11:22 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Check whether an user(account) is delegated to send mail on behalf

Note that if a user has a permission to be a delegate, it does not
necessarily mean that the other user's mailbox will be added to
Tools"--"Options.."-- "Delegates".
On the Extended MAPI level, you will need to work with the
PR_EMS_AB_PUBLIC_DELEGATES and PR_EMS_AB_PUBLIC_DELEGATES _BL_O MAPI
propeties exposed by a particular user.
Redemption exposes these collections through the RDOAddressEntry.Delegates
and RDOAddressEntry.IsDelegateFor collections.

--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-
"Ken Slovak - [MVP - Outlook]" wrote in message
...
That's not available in the Outlook object model. You can read the folder
permissions using a lower level API such as CDO 1.21 or Redemption
(www.dimastr.com/redemption) or Extended MAPI (C++ or Delphi only).

Here's an example of reading folder permissions using CDO 1.21 (optional
installation for Outlook and mostly deprecated now):
http://www.cdolive.com/aclviewer.htm.

You can do similar things using those other API's. If you are using
Outlook 2007 you could use similar code using Folder.PropertyAccessor to
read the ACL's. Of course then you'd need to interpret the data you get
back.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Kalyan" wrote in message
...
I need to programmatically check whether an user(account) is delegated to
"send mail on behalf of somebody" else. I'm referring to this feature in
outlook, in the outlook menu "Tools"--"Options.."-- "Delegates" tab.

I can't able to figure out from VBA programming API. Could anybody pls
help
to figure out this with VB/vbscript code?




  #4  
Old January 22nd 09, 09:31 PM posted to microsoft.public.outlook.program_vba
Kalyan
external usenet poster
 
Posts: 8
Default Check whether an user(account) is delegated to send mail on be

Dnitry, Thanks much for coming in to help. I got it right in Redemption..

Ken : Could you pls provide some references for this CDO API libraray, the
one similar to Outlook Object Model API reference provided my Microsoft/MSDN?

I tried this vbscript, but got an "permission denied" error on the line
"Session.Logon"

"Ken Slovak - [MVP - Outlook]" wrote:

That's not available in the Outlook object model. You can read the folder
permissions using a lower level API such as CDO 1.21 or Redemption
(www.dimastr.com/redemption) or Extended MAPI (C++ or Delphi only).

Here's an example of reading folder permissions using CDO 1.21 (optional
installation for Outlook and mostly deprecated now):
http://www.cdolive.com/aclviewer.htm.

You can do similar things using those other API's. If you are using Outlook
2007 you could use similar code using Folder.PropertyAccessor to read the
ACL's. Of course then you'd need to interpret the data you get back.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Kalyan" wrote in message
...
I need to programmatically check whether an user(account) is delegated to
"send mail on behalf of somebody" else. I'm referring to this feature in
outlook, in the outlook menu "Tools"--"Options.."-- "Delegates" tab.

I can't able to figure out from VBA programming API. Could anybody pls
help
to figure out this with VB/vbscript code?



  #5  
Old January 22nd 09, 10:07 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Check whether an user(account) is delegated to send mail on be

Do you have CDO installed?

It's an optional installation from the Office CD in versions prior to
Outlook 2007 and available as a separate download from MS for Outlook 2007.

You don't get any errors when you use CreateObject() or New on a
MAPI.Session?

The best source for CDO information and code is at the cdolive Web site.
That site also has a link to the CDO HLP file, and links to various KB
articles on CDO. The Digging Deeper Into CDO topic has a link to download a
zip of the CDO HLP.

There isn't really anything new for CDO since MS doesn't recommend it any
longer for anything but special development cases, no new development on it
has been done other than versioning updates for at least 6 years and it's
not supported for use in managed code. So CDOLive is the place to go.

If CDO is installed and registered then a Logon shouldn't occur if you have
any Outlook profiles on that machine. The best logon to use in that case is:

Session.Logon "", "", False, False

That will use an existing Outlook profile.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Kalyan" wrote in message
...
Dnitry, Thanks much for coming in to help. I got it right in Redemption..

Ken : Could you pls provide some references for this CDO API libraray,
the
one similar to Outlook Object Model API reference provided my
Microsoft/MSDN?

I tried this vbscript, but got an "permission denied" error on the line
"Session.Logon"


  #6  
Old January 23rd 09, 01:41 PM posted to microsoft.public.outlook.program_vba
Kalyan
external usenet poster
 
Posts: 8
Default Check whether an user(account) is delegated to send mail on be

Ken:

I'm trying the following code to access the addressbook and the delegates
property. The code (with MAPI.Session) is running and I can able to select
entry from addressbook.I'm trying to access these properties

PR_EMS_AB_PUBLIC_DELEGATES &H8015000D
PR_EMS_AB_PUBLIC_DELEGATES_BL &H8110101E
PR_EMS_AB_PUBLIC_DELEGATES_BL_O &H8110000D

using Fields(prop) which returns nothing. Could u pls help me?

Code snippet:

Set objOutlook1 = CreateObject("Outlook.Application")
outlookObj.Application.ActiveExplorer.WindowState = 1 'Minimize
window
objOutlook1.ActiveExplorer.Activate()
Set olemSession = objOutlook1.CreateObject("MAPI.Session")
ReturnCode = olemSession.Logon( "", "", False, False, 0 )
Set myUser = olemSession.CurrentUser
objOutlook1.Application.ActiveExplorer.WindowState = 0
objOutlook1.ActiveExplorer.Activate()
Set colCDORecips = olemSession.AddressBook(Nothing,"Select
Recipients Names", False, True, 1,"To")
ScError=CStr(Err.number)
if StrComp(ScError,"-2147219963",1) = 0 then
mVar=MsgBox("Outlook is not running.",vbCritical,"Error")
exit function
end if
count=colCDORecips.Count
for i2003 = 1 to count
set entry=colCDORecips.Item(i2003)
MsgBox("DisplayType " & entry.AddressEntry.DisplayType)
MsgBox(TypeName(entry.AddressEntry))
if entry.AddressEntry.Type = "EX" then
set delegEntries=entry.AddressEntry.Fields(&H8015000E)
MsgBox TypeName(delegEntries)
MsgBox delegEntries
set delegEntries=entry.AddressEntry.Fields(&H8110000E)
MsgBox TypeName(delegEntries)
MsgBox delegEntries
set delegEntries=entry.AddressEntry.Fields(&H8110101F)
MsgBox TypeName(delegEntries)
MsgBox delegEntries
end if
.....

-Kalyan


"Ken Slovak - [MVP - Outlook]" wrote:

Do you have CDO installed?

It's an optional installation from the Office CD in versions prior to
Outlook 2007 and available as a separate download from MS for Outlook 2007.

You don't get any errors when you use CreateObject() or New on a
MAPI.Session?

The best source for CDO information and code is at the cdolive Web site.
That site also has a link to the CDO HLP file, and links to various KB
articles on CDO. The Digging Deeper Into CDO topic has a link to download a
zip of the CDO HLP.

There isn't really anything new for CDO since MS doesn't recommend it any
longer for anything but special development cases, no new development on it
has been done other than versioning updates for at least 6 years and it's
not supported for use in managed code. So CDOLive is the place to go.

If CDO is installed and registered then a Logon shouldn't occur if you have
any Outlook profiles on that machine. The best logon to use in that case is:

Session.Logon "", "", False, False

That will use an existing Outlook profile.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Kalyan" wrote in message
...
Dnitry, Thanks much for coming in to help. I got it right in Redemption..

Ken : Could you pls provide some references for this CDO API libraray,
the
one similar to Outlook Object Model API reference provided my
Microsoft/MSDN?

I tried this vbscript, but got an "permission denied" error on the line
"Session.Logon"



  #7  
Old January 23rd 09, 03:08 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Check whether an user(account) is delegated to send mail on be

CDO does not expose those properties, so you can't use CDO for that. See
http://www.wiredbox.net/Forum/Thread...at _once.aspx

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Kalyan" wrote in message
...
Ken:

I'm trying the following code to access the addressbook and the delegates
property. The code (with MAPI.Session) is running and I can able to select
entry from addressbook.I'm trying to access these properties

PR_EMS_AB_PUBLIC_DELEGATES &H8015000D
PR_EMS_AB_PUBLIC_DELEGATES_BL &H8110101E
PR_EMS_AB_PUBLIC_DELEGATES_BL_O &H8110000D

using Fields(prop) which returns nothing. Could u pls help me?

Code snippet:

Set objOutlook1 = CreateObject("Outlook.Application")
outlookObj.Application.ActiveExplorer.WindowState = 1 'Minimize
window
objOutlook1.ActiveExplorer.Activate()
Set olemSession = objOutlook1.CreateObject("MAPI.Session")
ReturnCode = olemSession.Logon( "", "", False, False, 0 )
Set myUser = olemSession.CurrentUser
objOutlook1.Application.ActiveExplorer.WindowState = 0
objOutlook1.ActiveExplorer.Activate()
Set colCDORecips = olemSession.AddressBook(Nothing,"Select
Recipients Names", False, True, 1,"To")
ScError=CStr(Err.number)
if StrComp(ScError,"-2147219963",1) = 0 then
mVar=MsgBox("Outlook is not running.",vbCritical,"Error")
exit function
end if
count=colCDORecips.Count
for i2003 = 1 to count
set entry=colCDORecips.Item(i2003)
MsgBox("DisplayType " & entry.AddressEntry.DisplayType)
MsgBox(TypeName(entry.AddressEntry))
if entry.AddressEntry.Type = "EX" then
set delegEntries=entry.AddressEntry.Fields(&H8015000E)
MsgBox TypeName(delegEntries)
MsgBox delegEntries
set delegEntries=entry.AddressEntry.Fields(&H8110000E)
MsgBox TypeName(delegEntries)
MsgBox delegEntries
set delegEntries=entry.AddressEntry.Fields(&H8110101F)
MsgBox TypeName(delegEntries)
MsgBox delegEntries
end if
.....

-Kalyan


"Ken Slovak - [MVP - Outlook]" wrote:

Do you have CDO installed?

It's an optional installation from the Office CD in versions prior to
Outlook 2007 and available as a separate download from MS for Outlook
2007.

You don't get any errors when you use CreateObject() or New on a
MAPI.Session?

The best source for CDO information and code is at the cdolive Web site.
That site also has a link to the CDO HLP file, and links to various KB
articles on CDO. The Digging Deeper Into CDO topic has a link to download
a
zip of the CDO HLP.

There isn't really anything new for CDO since MS doesn't recommend it any
longer for anything but special development cases, no new development on
it
has been done other than versioning updates for at least 6 years and it's
not supported for use in managed code. So CDOLive is the place to go.

If CDO is installed and registered then a Logon shouldn't occur if you
have
any Outlook profiles on that machine. The best logon to use in that case
is:

Session.Logon "", "", False, False

That will use an existing Outlook profile.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Kalyan" wrote in message
...
Dnitry, Thanks much for coming in to help. I got it right in
Redemption..

Ken : Could you pls provide some references for this CDO API libraray,
the
one similar to Outlook Object Model API reference provided my
Microsoft/MSDN?

I tried this vbscript, but got an "permission denied" error on the line
"Session.Logon"




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A program is trying to automatically send e-mail on your behalf. PeteCresswell Outlook - General Queries 6 July 25th 08 02:05 AM
Sharing Calendar on a delegated account WGHS JB Outlook - Calandaring 1 June 26th 08 01:51 PM
how do check e-mail and where do i go to fix account pop3 Lorayne Thomas Outlook Express 2 April 13th 07 03:50 AM
Setting a rule on mail send on behalf of me ActiveHub Outlook - Installation 0 November 15th 06 05:08 PM
how can i check an e-mail account i have from my workplace hopeful for help Outlook - General Queries 1 February 11th 06 01:54 AM


All times are GMT +1. The time now is 01:06 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.