Solved

Determine account using Outlook region and VB.net

Posted on 2014-01-08
5
490 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

734 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