Solved

Determine account using Outlook region and VB.net

Posted on 2014-01-08
5
467 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Programmatically signing Word macros 4 61
Vb.net dynamic formulas in runtime 11 61
Not showing JavaScript in the list 5 36
Ajax Panel Not Updating When Triggered By Timer 4 37
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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 video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

932 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

9 Experts available now in Live!

Get 1:1 Help Now