cdoSession.CurrentUser = "unknown"

  • Thread starter Thread starter Gordon Prince, MCP
  • Start date Start date
G

Gordon Prince, MCP

I've had an application that creates a cdoSession from Outlook in an environment with an Exchange 2000 server. Now I'm trying to get the same application to create a cdoSession in an environment that doesn't have Exchange 2000 server.

Here's the code:
sub SubName(cdoMessage as MAPI.Message)
Dim cdoSession As MAPI.Session
Dim cdoMessage2 As MAPI.Message
Set cdoSession = cdoMessage.Session
cdoMessage2.Sender = cdoSession.CurrentUser
...

In the Exchange environment cdoSession.CurrentUser is a valid object.
In the non-Exchange environment, cdoSession.CurrentUser = "unknown".

I've looked through the help files & the newsgroup history but for the life of me can't figure out how to set cdoMessage2.Sender. Any ideas?

Thanks.
 
IIRC, this is a known issue in some Outlook versions and configurations.
Perhaps you'll want to explain more about what you're planning to do with
the CurrentUser information?
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



I've had an application that creates a cdoSession from Outlook in an
environment with an Exchange 2000 server. Now I'm trying to get the same
application to create a cdoSession in an environment that doesn't have
Exchange 2000 server.

Here's the code:
sub SubName(cdoMessage as MAPI.Message)
Dim cdoSession As MAPI.Session
Dim cdoMessage2 As MAPI.Message
Set cdoSession = cdoMessage.Session
cdoMessage2.Sender = cdoSession.CurrentUser
...

In the Exchange environment cdoSession.CurrentUser is a valid object.
In the non-Exchange environment, cdoSession.CurrentUser = "unknown".

I've looked through the help files & the newsgroup history but for the life
of me can't figure out how to set cdoMessage2.Sender. Any ideas?

Thanks.
 
I'm copying a Sent message to a public folder. I have to set the
cdoMessage.Sender. I thought setting it to cdoSession.CurrentUser would be
the easiest way to do this.

Perhaps you can suggest another way to set the cdoMessage.Sender.

Thanks for any ideas.
 
You lost me. If it's not Exchange, there are no public folders.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Sorry about the Public Folder. What I meant to say was that I'm copying the
sent item to a .PST file that's on a shared drive so that everyone can
access it.
 
I'm still confused. If it's already sent, why do you want to change the
sender? Furthermore, a .pst file on a shared drive cannot be used for shared
access; it's still a single-user file.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Once the mail item is sent it will be in the user's Sent Items folder. I'm
making a copy of the item to save in the .pst file on the shared drive,
which any one user at a time can use (I know this seems unusable, but that's
what I've got to work with for this site for this day).

I'm trying to set the .Sender information because the item disappears (which
it will as soon as I issue the .Send command). All the other fields can be
set except the .Sender.

So is there a way to set .Sender to be something if cdoSession.CurrentUser
returns "unknown"? I know this whole thing is a bit of beating a dead horse,
but it seems like there should be a way to work around this and somehow set
..Sender to be something, even if it is a bit kludgy.

Thanks for any ideas.
 
No, you can't set Sender directly. It's set by Outlook after the item has
actually been sent. Why not monitor the Sent Items folder and copy items as
the arrive? They'll have proper sender information at that point.
 
Gotcha. Thanks for the ideas.

Sue Mosher said:
No, you can't set Sender directly. It's set by Outlook after the item has
actually been sent. Why not monitor the Sent Items folder and copy items as
the arrive? They'll have proper sender information at that point.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top