cdoSession.CurrentUser = "unknown"

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.
 
S

Sue Mosher [MVP]

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.
 
G

Gordon Prince, MCP

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.
 
S

Sue Mosher [MVP]

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
 
G

Gordon Prince, MCP

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.
 
S

Sue Mosher [MVP]

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
 
G

Gordon Prince, MCP

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.
 
S

Sue Mosher [MVP]

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.
 
G

Gordon Prince, MCP

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top