Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: Email address of the current user

Geek News

Email address of the current user
cookiesncreamychoc[ at ]hotmail.com 9/7/2006 11:55:20 PM
Hi Ppl,

I need to retrieve the email address of the current user from an
Appointment item using VB.NET (VS 05) via an add-in.

[Quoted Text]
>From what is already out there,
1. Session.CurrentUser may return the SMTP address or the distinguished
name. Which setting on the Exchange server determines what it returns
plz? (Cannot use LDAP as the user may not always be connected to the
Internet/Intranet)
2. In the above scenario, there may or may not be a security message
box. What determines the pop up of this box?
3. Use CDO. There are examples for using it with MailItem. Is it
possible with an Appointment Item?
4. Any alternate solution?

Thnx

Re: Email address of the current user
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 9/8/2006 12:41:10 AM
1. No such setting. If the Exchange provider is responsible for the user
identity in the profile, you will always get an EX type address. You *can*
retrieve the SMTP address(es) from an EX address entry.
2. Version of Outlook and the API that uou are using - see
http://www.outlookcode.com/d/sec.htm
3. Yes. To do what?
4. Solution to always retrieving an SMTP address? You will need to use
Extended MAPI, CDO 1.21 or Redemption (no OOM) to retrieve either teh
PR_SMTP_ADDRESS property (may not be available in the cached mode) or
PR_EMS_AB_PROXY_ADDRESSES property.
<plug>
Redemption (url below) exposes SMTPAddress property on the address entries:
set Session = CreateObject("Redemption.RDOSession")
Session.MAPIOBJECT = Application.Session.MAPIOBJECT 'Outlook 2002 and up
MsgBox Session.CurrentUser.SMTPAddress
</plug>

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

<cookiesncreamychoc[ at ]hotmail.com> wrote in message
news:1157673320.867102.4660[ at ]e3g2000cwe.googlegroups.com...
[Quoted Text]
> Hi Ppl,
>
> I need to retrieve the email address of the current user from an
> Appointment item using VB.NET (VS 05) via an add-in.
>
>>From what is already out there,
> 1. Session.CurrentUser may return the SMTP address or the distinguished
> name. Which setting on the Exchange server determines what it returns
> plz? (Cannot use LDAP as the user may not always be connected to the
> Internet/Intranet)
> 2. In the above scenario, there may or may not be a security message
> box. What determines the pop up of this box?
> 3. Use CDO. There are examples for using it with MailItem. Is it
> possible with an Appointment Item?
> 4. Any alternate solution?
>
> Thnx
>


Re: Email address of the current user
cookiesncreamychoc[ at ]hotmail.com 9/8/2006 1:31:43 AM
Thanx for the prompt reply.

1. I CAN retrieve the SMTP address(es) from an EX address
entry...really ...How?
3. To retrieve the current user's SMTP address from Appointment form.
4. Extended MAPI, CDO 1.21 - any examples for C# or VB.Net plz?

TIA

Dmitry Streblechenko wrote:
[Quoted Text]
> 1. No such setting. If the Exchange provider is responsible for the user
> identity in the profile, you will always get an EX type address. You *can*
> retrieve the SMTP address(es) from an EX address entry.
> 2. Version of Outlook and the API that uou are using - see
> http://www.outlookcode.com/d/sec.htm
> 3. Yes. To do what?
> 4. Solution to always retrieving an SMTP address? You will need to use
> Extended MAPI, CDO 1.21 or Redemption (no OOM) to retrieve either teh
> PR_SMTP_ADDRESS property (may not be available in the cached mode) or
> PR_EMS_AB_PROXY_ADDRESSES property.
> <plug>
> Redemption (url below) exposes SMTPAddress property on the address entries:
> set Session = CreateObject("Redemption.RDOSession")
> Session.MAPIOBJECT = Application.Session.MAPIOBJECT 'Outlook 2002 and up
> MsgBox Session.CurrentUser.SMTPAddress
> </plug>
>
> Dmitry Streblechenko (MVP)
> http://www.dimastr.com/
> OutlookSpy - Outlook, CDO
> and MAPI Developer Tool
>
> <cookiesncreamychoc[ at ]hotmail.com> wrote in message
> news:1157673320.867102.4660[ at ]e3g2000cwe.googlegroups.com...
> > Hi Ppl,
> >
> > I need to retrieve the email address of the current user from an
> > Appointment item using VB.NET (VS 05) via an add-in.
> >
> >>From what is already out there,
> > 1. Session.CurrentUser may return the SMTP address or the distinguished
> > name. Which setting on the Exchange server determines what it returns
> > plz? (Cannot use LDAP as the user may not always be connected to the
> > Internet/Intranet)
> > 2. In the above scenario, there may or may not be a security message
> > box. What determines the pop up of this box?
> > 3. Use CDO. There are examples for using it with MailItem. Is it
> > possible with an Appointment Item?
> > 4. Any alternate solution?
> >
> > Thnx
> >

Re: Email address of the current user
"Dmitry Streblechenko" <dmitry[ at ]dimastr.com> 9/8/2006 5:44:44 AM
1. See #4
2. But the current user's e-mail address has nothing to do with a given
appointment, does it not?
3. You cannot access Extended MAPI from .Net, at least MS does not support
that. There is a MAPI33 library that allows to use Extended MAPi from .Net
languages (I thing VB.Net only, but not C#), but if you never tried Extended
MAPI, don't expect this to be an easy one afternoon project. In CDO 1.21 you
will need to access Session.CurrentUser property, then use
AddressEntry.Fields() to read the PR_SMTP_ADDRESS or
PR_EMS_AB_PROXY_ADDRESSES property. See
http://www.outlookcode.com/d/code/getsenderaddy.htm for an example that
reads a sender SMTP address.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

<cookiesncreamychoc[ at ]hotmail.com> wrote in message
news:1157679103.196949.186100[ at ]m79g2000cwm.googlegroups.com...
[Quoted Text]
> Thanx for the prompt reply.
>
> 1. I CAN retrieve the SMTP address(es) from an EX address
> entry...really ...How?
> 3. To retrieve the current user's SMTP address from Appointment form.
> 4. Extended MAPI, CDO 1.21 - any examples for C# or VB.Net plz?
>
> TIA
>
> Dmitry Streblechenko wrote:
>> 1. No such setting. If the Exchange provider is responsible for the user
>> identity in the profile, you will always get an EX type address. You
>> *can*
>> retrieve the SMTP address(es) from an EX address entry.
>> 2. Version of Outlook and the API that uou are using - see
>> http://www.outlookcode.com/d/sec.htm
>> 3. Yes. To do what?
>> 4. Solution to always retrieving an SMTP address? You will need to use
>> Extended MAPI, CDO 1.21 or Redemption (no OOM) to retrieve either teh
>> PR_SMTP_ADDRESS property (may not be available in the cached mode) or
>> PR_EMS_AB_PROXY_ADDRESSES property.
>> <plug>
>> Redemption (url below) exposes SMTPAddress property on the address
>> entries:
>> set Session = CreateObject("Redemption.RDOSession")
>> Session.MAPIOBJECT = Application.Session.MAPIOBJECT 'Outlook 2002 and up
>> MsgBox Session.CurrentUser.SMTPAddress
>> </plug>
>>
>> Dmitry Streblechenko (MVP)
>> http://www.dimastr.com/
>> OutlookSpy - Outlook, CDO
>> and MAPI Developer Tool
>>
>> <cookiesncreamychoc[ at ]hotmail.com> wrote in message
>> news:1157673320.867102.4660[ at ]e3g2000cwe.googlegroups.com...
>> > Hi Ppl,
>> >
>> > I need to retrieve the email address of the current user from an
>> > Appointment item using VB.NET (VS 05) via an add-in.
>> >
>> >>From what is already out there,
>> > 1. Session.CurrentUser may return the SMTP address or the distinguished
>> > name. Which setting on the Exchange server determines what it returns
>> > plz? (Cannot use LDAP as the user may not always be connected to the
>> > Internet/Intranet)
>> > 2. In the above scenario, there may or may not be a security message
>> > box. What determines the pop up of this box?
>> > 3. Use CDO. There are examples for using it with MailItem. Is it
>> > possible with an Appointment Item?
>> > 4. Any alternate solution?
>> >
>> > Thnx
>> >
>


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net