Solved

Determine account using Outlook region and VB.net

Posted on 2014-01-08
5
461 Views
Last Modified: 2014-01-16
I'm trying to determine the user account of a person by way of an Outlook region and vb.net.  In short, someone will be logged into Exchange using Outlook and through a Outlook region form, save information back to my SQL server.  When this info is saved, I need to identify the person saving the record and the best method in this case would be the person logged into Outlook and sending emails.  Any direction on how to begin would be appreciated.

Thanks.
0
Comment
Question by:TheChos
  • 3
  • 2
5 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 39770666
Hi, TheChos.

I'm not clear on what you're doing.  I'm assuming that you're talking about a custom Outlook form that's using a region to collect data.  Is that correct?  If so, then the code is running inside of Outlook, meaning you can use Outlook's own object model to find out who the user is.  

session.CurrentUser.Name

Open in new window


returns the name of the current user.
0
 

Author Comment

by:TheChos
ID: 39770758
That's what I'm looking for but I need a little help regarding the session portion of your answer.  How do I declare/assign that piece?
0
 
LVL 76

Accepted Solution

by:
David Lee earned 500 total points
ID: 39770980
I'm not clear on whether your code is in Outlook or is an add-in, running outside of Outlook.  If it's the former, then Session is an existing variable in Outlook.  There's no need to declare it, just reference it.  If the code is running from an add-in, then you likely already have an object that's an instance of Outlook.  If the name of that object were objOutlook, then you'd access Session like this

objOutlook.Session.CurrentUser.Name

Open in new window

0
 

Author Closing Comment

by:TheChos
ID: 39785725
Worked perfectly.  Thank you!
0
 
LVL 76

Expert Comment

by:David Lee
ID: 39786322
You're welcome!
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now