|
-
Jan 6th, 2006, 05:01 PM
#1
Thread Starter
Member
Find User Name
I want to know how to find the name of the current user
I tried the following
Set onamespace = Application.GetNamespace("MAPI")
name = onamespace.CurrentUser
But it pops up a message requesting us to click yes to allow access ... I want to avoid this message ..
Pls give me sample code with a new method or a method to avoid this message
-
Jan 7th, 2006, 11:18 AM
#2
Re: Find User Name
It shouldnt create the infamous Outlook Security Popup if your executing the code from Outlooks VBA.
VB Code:
MsgBox Application.Session.CurrentUser
If your executing it from outside of Outlook then you cant get around it unless you convert your app to a Trusted Outlook Add-In or use a third party program to dismiss the security prompt (not a good suggestion though).
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 8th, 2006, 07:47 AM
#3
Frenzied Member
Re: Find User Name
There's an API for this as well - GetUserName, I think.
Tengo mas preguntas que contestas
-
Jan 8th, 2006, 08:06 AM
#4
Re: Find User Name
Correct, my mistake if thats the one he wants. I was thinking Outlook user name but could also be Windows user name.
My FAQ thread 
http://www.vbforums.com/showthread.php?t=357723
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 9th, 2006, 09:14 AM
#5
Thread Starter
Member
Re: Find User Name
i tried it out but it still gives the popup .... please tell me how to go about it ... actually i am trying to get outlook username from VB application
Last edited by prasanna_jayakumar@y; Jan 9th, 2006 at 01:27 PM.
-
Jan 9th, 2006, 03:23 PM
#6
Re: Find User Name
You would need to write your app as a Trusted Outlook Add-In.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 9th, 2006, 03:54 PM
#7
Thread Starter
Member
Re: Find User Name
i checked out in Tools->Macros->Security ... but there is no facility to add my application ... cn u give me some suggestions for this
-
Jan 9th, 2006, 04:29 PM
#8
Re: Find User Name
In VB 6 when you start it up you get a choice of the type of app to create. Thats where you choose Add-In.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|