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 - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Tags: , , ,

Beginner: Need unique ID of Outlook account





 
 
Thread Tools Display Modes
  #1  
Old February 9th 07, 02:52 PM posted to microsoft.public.outlook.program_forms
masta
external usenet poster
 
Posts: 6
Default Beginner: Need unique ID of Outlook account

I search a unique ID for an Outlook (2003) account (not the email address).
Even when changing machine and accessing the same (Exchange-)account, this ID
should be the same.

Details:
I have a (.net 2.0) application with a connection to a (SQL2005) database.
There are some deadlines (stored in the DB) that a user can select to
synchronize with Outlook.
If the user chooses to synchronize a deadline, I simply store the unique
Outlook entry ID in the DB, along with the Windows user SID, so that I know
for which user this deadline is synchronized.
The missing piece now is a unique ID for the Outlook account. This way I
would be able to know if the user is working on the same account (not the
email address, the "real" Outlook account) or not when logged in on another
machine.

I'm developing with Visual Studio 2005 SP1 and Office 2003 SP1 with the PIOs
installed.

Thanks for your help
Ads
  #2  
Old February 9th 07, 03:42 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,793
Default Beginner: Need unique ID of Outlook account

I don't understand what you mean by account. Is that the Outlook profile or
mailbox or what?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"masta" mailätmastapunktch wrote in message
...
I search a unique ID for an Outlook (2003) account (not the email address).
Even when changing machine and accessing the same (Exchange-)account, this
ID
should be the same.

Details:
I have a (.net 2.0) application with a connection to a (SQL2005) database.
There are some deadlines (stored in the DB) that a user can select to
synchronize with Outlook.
If the user chooses to synchronize a deadline, I simply store the unique
Outlook entry ID in the DB, along with the Windows user SID, so that I
know
for which user this deadline is synchronized.
The missing piece now is a unique ID for the Outlook account. This way I
would be able to know if the user is working on the same account (not the
email address, the "real" Outlook account) or not when logged in on
another
machine.

I'm developing with Visual Studio 2005 SP1 and Office 2003 SP1 with the
PIOs
installed.

Thanks for your help


  #3  
Old February 9th 07, 04:28 PM posted to microsoft.public.outlook.program_forms
masta
external usenet poster
 
Posts: 6
Default Beginner: Need unique ID of Outlook account

Hi Ken, thanks for your time.

Well what I need is to be sure that the user is accessing the same Outlook
account. I guess that would be the profile then.

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

I don't understand what you mean by account. Is that the Outlook profile or
mailbox or what?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"masta" mailätmastapunktch wrote in message
...
I search a unique ID for an Outlook (2003) account (not the email address).
Even when changing machine and accessing the same (Exchange-)account, this
ID
should be the same.

Details:
I have a (.net 2.0) application with a connection to a (SQL2005) database.
There are some deadlines (stored in the DB) that a user can select to
synchronize with Outlook.
If the user chooses to synchronize a deadline, I simply store the unique
Outlook entry ID in the DB, along with the Windows user SID, so that I
know
for which user this deadline is synchronized.
The missing piece now is a unique ID for the Outlook account. This way I
would be able to know if the user is working on the same account (not the
email address, the "real" Outlook account) or not when logged in on
another
machine.

I'm developing with Visual Studio 2005 SP1 and Office 2003 SP1 with the
PIOs
installed.

Thanks for your help



  #4  
Old February 9th 07, 07:36 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,793
Default Beginner: Need unique ID of Outlook account

You cannot get that from the Outlook object model for Outlook 2003.

If you are using the Redemption MAPI library that has an
RDOSession.ProfileName property that tells you the current profile. You can
also get that information using other lower level API's such as CDO 1.21 or
Extended MAPI (C++ or Delphi only).

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"masta" mailätmastapunktch wrote in message
...
Hi Ken, thanks for your time.

Well what I need is to be sure that the user is accessing the same Outlook
account. I guess that would be the profile then.


  #5  
Old February 12th 07, 09:16 AM posted to microsoft.public.outlook.program_forms
masta
external usenet poster
 
Posts: 6
Default Beginner: Need unique ID of Outlook account

Thanks for your reply.
I tried using CDO 1.21 but I can't find any profile details by checking the
properties of the Session object.

Here's the code I used:
Session session = new SessionClass();
Object vEmpty = Missing.Value;
session.Logon(vEmpty, vEmpty, false, false, vEmpty, vEmpty, vEmpty);
string sessionstr = session.ToString(); //"MAPI.SessionClass"
string sessionnamestr = session.Name.ToString(); //"Outlook"
string sessioncurrentuserstr = session.CurrentUser.ToString();
//"System.__ComObject"
string sessionsessionstr = session.Session.ToString();//"MAPI.SessionClass"

Where is there any additional info regarding the profile used?
Thanks for your help
  #6  
Old February 12th 07, 09:29 AM posted to microsoft.public.outlook.program_forms
masta
external usenet poster
 
Posts: 6
Default Beginner: Need unique ID of Outlook account

I also made the test with the Redemption MAPI:
RDOSession.ProfileName property simply returns "Outlook", like with CDO.

I don't think this is enough information for my situation. If Outlook were
connected to a (say) POP3 account rather than Exchange, would that profile
name still be "Outlook"?

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

You cannot get that from the Outlook object model for Outlook 2003.

If you are using the Redemption MAPI library that has an
RDOSession.ProfileName property that tells you the current profile. You can
also get that information using other lower level API's such as CDO 1.21 or
Extended MAPI (C++ or Delphi only).

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"masta" mailätmastapunktch wrote in message
...
Hi Ken, thanks for your time.

Well what I need is to be sure that the user is accessing the same Outlook
account. I guess that would be the profile then.



  #7  
Old February 12th 07, 11:45 AM posted to microsoft.public.outlook.program_forms
masta
external usenet poster
 
Posts: 6
Default Beginner: Need unique ID of Outlook account

OK, maybe it's easier to do it like that:
Is there any way to programmatically detect if Outlook (2003) is hooked up
to an Exchange server or not?
Also, is it possible to detect that without the annoying security message?
("allow access?" message)

Thank you


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

You cannot get that from the Outlook object model for Outlook 2003.

If you are using the Redemption MAPI library that has an
RDOSession.ProfileName property that tells you the current profile. You can
also get that information using other lower level API's such as CDO 1.21 or
Extended MAPI (C++ or Delphi only).

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"masta" mailätmastapunktch wrote in message
...
Hi Ken, thanks for your time.

Well what I need is to be sure that the user is accessing the same Outlook
account. I guess that would be the profile then.



  #8  
Old February 12th 07, 12:41 PM posted to microsoft.public.outlook.program_forms
masta
external usenet poster
 
Posts: 6
Default Beginner: Need unique ID of Outlook account

Sorry about all the messages, I just seem to make some progress:

Using the PIOs, and the Outlook.ApplicationClass object, I now found maybe
what I was looking for.
outLookApp.Session.CurrentUser.EntryID // a string
outLookApp.Session.ExchangeConnectionMode // an int (type)
The current user entry ID seems to be what I was initially looking for. The
Exchange connection mode also has a type "non-exchange" which also looks
interesting for my problem.

I still have to do some testing, if this is the real deal, but it looks very
good.

  #9  
Old February 12th 07, 04:16 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 3,793
Default Beginner: Need unique ID of Outlook account

No matter what store provider is used a profile name is a profile name. The
default is "Outlook" and if the user never created one with a different name
that's what you get.

The usual hack from CDO for finding out if the store is an Exchange store
would be to get the StoreID property of a folder in a store. You then
convert that hex string into ANSI characters and if inside the string is
"EMSMDB.DLL" then the store is a mailbox. For a PST file it would be
something like "mspst.dll". Do a case insensitive search for those terms.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"masta" mailätmastapunktch wrote in message
...
I also made the test with the Redemption MAPI:
RDOSession.ProfileName property simply returns "Outlook", like with CDO.

I don't think this is enough information for my situation. If Outlook were
connected to a (say) POP3 account rather than Exchange, would that profile
name still be "Outlook"?

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

You cannot get that from the Outlook object model for Outlook 2003.

If you are using the Redemption MAPI library that has an
RDOSession.ProfileName property that tells you the current profile. You
can
also get that information using other lower level API's such as CDO 1.21
or
Extended MAPI (C++ or Delphi only).

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"masta" mailätmastapunktch wrote in message
...
Hi Ken, thanks for your time.

Well what I need is to be sure that the user is accessing the same
Outlook
account. I guess that would be the profile then.




 




Thread Tools
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
multiple calendars are not showing unique names.. one has no name Jeannie Outlook - Calandaring 0 December 20th 06 09:34 PM
How can I define unique font per each Outlook profile? zephyr Outlook - General Queries 2 May 16th 06 07:07 AM
Obtaining unique ID for contact? miner2049er Outlook - Using Contacts 6 April 29th 06 07:43 PM
How do I set a unique signature for each profile? Lou S. Outlook - Installation 1 February 21st 06 10:33 PM
What makes a ContactItem unique jim Add-ins for Outlook 1 January 19th 06 04:14 PM


All times are GMT +1. The time now is 04:32 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2008 Outlook Banter, part of the NewsgroupBanter project.
The comments are property of their posters.
Mobile Phones - Jewelry Necklaces - Car Loans - Credit Cards UK - Credit Counseling