I haven't done this with any VB.NET addins so I'm not sure it will work
there but in a standard COM addin using VB 6 one way is to expose your
global in the designer (the class that implements IDTExtensibility2 and
handles OnConnection). The global can be exposed as a public property.
You can then iterate the Outlook.Application.COMAddins collection looking at
the ProgID properties of each addin until you find yours. You can then
access the global property from there.
The code would look something like this:
Dim m_oAddinBase As Object
Dim lngID As Integer
m_oAddinBase = g_objOL.COMAddIns("MyAddin.Connect").Object
lngID = m_oAddinBase.UserID
--
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
wrote in message
ups.com...
Hi,
This probably isnt possible but...
I have an Outlook add-in that requests username and password (these are
not the active directory credentials but are related to another
application) when Outlook first starts. Once authenticated (against
username and password in a database), the ID for the user is saved as a
global variable in the add-in for future use.
I also have a Windows application that launches outlook when a certain
button is clicked. I need to check the userID of the user logged into
Outlook. Is there a way to access global variable of the add-in from
another application?
Alternatively, can I save the userID as a session variable in Outlook?
Thanx in advance
P.S. Both the application and add-in are written in VB (VS2005) but the
add-in does NOT use VSTO.