View Single Post
  #3  
Old November 5th 08, 03:26 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Is there a way to get the profile name

The CDO download is only for Outlook 2007, where there is already a
NameSpace.CurrentProfileName property available. CDO 1.21 for earlier
versions of Outlook is located on the Office CD.

Also, if the code is to be managed code CDO is not supported for use in
managed code.

--
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


"Alan Moseley" wrote in message
...
You cannot do this from the Outlook Object Model, but if you download and
install CDO 1.21 you can use the following function:-

Public Function GetProfileName() As String
Dim MySession As MAPI.Session
Set MySession = CreateObject("MAPI.Session")
MySession.Logon "", "", False, False
GetCurrentProfileName = MySession.Name
MySession.Logoff
Set MySession = Nothing
End Function

--
Alan Moseley IT Consultancy
http://www.amitc.co.uk

If I have solved your problem, please click Yes below. Thanks.


"Salad" wrote:

Is there a way to determine what the profile name that is in use in an
Outlook session? If so, can you provide a small code snippet
demonstration it or tell me what method or property to use?



Ads