![]() |
| 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. |
|
|||||||
| Tags: account, beginner, outlook, unique |
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
|||
|
|||
|
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 | |
|
|
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 |