![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I am creating a custom form in Outlook and would like to pull in the current
Users Manager's name. Any suggestions on where I go to find some code to accomplish that? |
Ads |
#2
|
|||
|
|||
![]()
You'd need to use code behind the form to set the value of the desired property to the string returned by Application.Session.CurrentUser.Manager. If you need a primer on working with Outlook properties, see http://www.outlookcode.com/article.aspx?ID=38
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Jenn" wrote in message ... I am creating a custom form in Outlook and would like to pull in the current Users Manager's name. Any suggestions on where I go to find some code to accomplish that? |
#3
|
|||
|
|||
![]() "Jenn" wrote in message ... I am creating a custom form in Outlook and would like to pull in the current Users Manager's name. Any suggestions on where I go to find some code to accomplish that? If by that you mean the user that's currently logged in to Windows, this will do it in VB6: Private Declare Function WNetGetUser Lib "mpr.dll" Alias "WNetGetUserA" (ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As Long Function GetLoggedInUser() As String Dim UserName As String, Ln As Long UserName = String$(1024, 0) Ln = 1023 WNetGetUser vbNullString, UserName, Ln GetLoggedInUser = UserName End Function -Mark |
#4
|
|||
|
|||
![]()
Form code (VBScript) can't use Win32 API functions.
-- 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 "Mark J. McGinty" wrote in message ... "Jenn" wrote in message ... I am creating a custom form in Outlook and would like to pull in the current Users Manager's name. Any suggestions on where I go to find some code to accomplish that? If by that you mean the user that's currently logged in to Windows, this will do it in VB6: Private Declare Function WNetGetUser Lib "mpr.dll" Alias "WNetGetUserA" (ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As Long Function GetLoggedInUser() As String Dim UserName As String, Ln As Long UserName = String$(1024, 0) Ln = 1023 WNetGetUser vbNullString, UserName, Ln GetLoggedInUser = UserName End Function -Mark |
#5
|
|||
|
|||
![]() "Ken Slovak - [MVP - Outlook]" wrote in message ... Form code (VBScript) can't use Win32 API functions. In that case: Set WshNetwork = CreateObject("Wscript.Network") UserName = WshNetwork.UserName -Mark 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 "Mark J. McGinty" wrote in message ... "Jenn" wrote in message ... I am creating a custom form in Outlook and would like to pull in the current Users Manager's name. Any suggestions on where I go to find some code to accomplish that? If by that you mean the user that's currently logged in to Windows, this will do it in VB6: Private Declare Function WNetGetUser Lib "mpr.dll" Alias "WNetGetUserA" (ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As Long Function GetLoggedInUser() As String Dim UserName As String, Ln As Long UserName = String$(1024, 0) Ln = 1023 WNetGetUser vbNullString, UserName, Ln GetLoggedInUser = UserName End Function -Mark |
#6
|
|||
|
|||
![]()
That would work.
Unless of course something like a script stopper prevents instantiating scripting objects. -- 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 "Mark J. McGinty" wrote in message ... "Ken Slovak - [MVP - Outlook]" wrote in message ... Form code (VBScript) can't use Win32 API functions. In that case: Set WshNetwork = CreateObject("Wscript.Network") UserName = WshNetwork.UserName -Mark |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I pull active directory information into an outlook form? | jcross | Outlook - Using Forms | 4 | April 25th 07 09:10 PM |
User cant pull up their contact's list when they try and send an e | ithandyman | Outlook - Using Contacts | 1 | August 14th 06 10:29 PM |
Emailing a contact vCard with custom form loses all custom info | Kim | Outlook - Using Contacts | 7 | April 27th 06 01:21 AM |
Insert into a new e-mail form user defined info from tasks | Logistics Masters | Outlook - Using Forms | 1 | March 20th 06 09:25 PM |
One user experiencing slow loading time for Custom Form | [email protected] | Outlook - Using Forms | 0 | March 9th 06 06:03 AM |