EXCEL Macro calling on Outlook
It does pull up my name but I still get that message that Outlook is trying
to access email. The problem is that it does put me back in the Excel
screen. It moves me over to Outlook and Excel button is flashing orange.
My people know what to do with the accessing email. It's the redirecting that
is causing trouble. Any ideas how to keep excel up front?
--
Gloriann O'Brien
"Bob Phillips" wrote:
You said the name of the logged on user, what Outlook is returning is the
Outlook profile - different things.
I couldn't reproduce the problem, but I wonder if it because Outlook is
already started. Try this
On Error Resume Next
Set objOutlook = GetObject(, "Outlook.Application")
On Error GoTo 0
If objOutlook Is Nothing Then
Set objOutlook = CreateObject("Outlook.Application")
Set NameSpace = objOutlook.GetNameSpace("MAPI").CurrentUser
MsgBox NameSpace.Name
Set objOutlook = Nothing
Else
Set NameSpace = objOutlook.GetNameSpace("MAPI").CurrentUser
MsgBox NameSpace.Name
End If
--
HTH
RP
(remove nothere from the email address if mailing direct)
"gobjob" wrote in message
...
Our Outlook must be configured different. This works but I don't get the
same username I get with Outlook GetNameSpace. My UserName in Outlook is
O'Brien, Gloriann but I log onto my computer with a UID. Eg. UID iq4qw08.
This is the name that shows up in the Excel cell. Do you have any idea
what
is going on? Can't find my UID in the set up.
--
Gloriann O'Brien
"Bob Phillips" wrote:
Excel can tell you
Environ("UserName")
--
HTH
RP
(remove nothere from the email address if mailing direct)
"gobjob" wrote in message
...
In order to sign a form, I am going to Outlook to find the name of the
person
who has logged onto the computer.
Set objOutlook = CreateObject("Outlook.Application")
Set NameSpace = objOutlook.GetNameSpace("MAPI").CurrentUser
However, when the code is executed, the Outlook application starts to
flash
orange and when clicked, the message about Outlook trying to send
email
appears. This is a problem because most people don't know what the
orange
flashing button means. Is there any other way to get the name of the
logged
on person?
--
Gloriann O'Brien
|