Im creating a form where all credentials are automatically populated by anyone who accesses it. However I am facing difficulties trying to get the user's email address.
Set olApp = CreateObject("Outlook.Application")
Set olNS = olApp.GetNamespace("MAPI")
UserEmail = olNS.CurrentUser.AddressEntry.GetExchangeUser.PrimarySmtpAddress
This one line could be taking >1 minute of some user's PC and few seconds on other's. Is there a way to skip this if its taking more than 5 seconds for example?
I'm thinking of applying application.ontime but dont know how to go from there.