Posting in a public folder / changing sender name.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi.

I'm using this code to post Item in the current folder , and i have 2
questions.

Dim olPost As Outlook.PostItem

Set olPost = ActiveExplorer.CurrentFolder.Items.Add("IPM.Post")

olPost.BodyFormat = olFormatHTML
olPost.HTMLBody = UserForm1.TextBox1.Value
olPost.Subject = title
olPost.UnRead = True
olPost.Save
olPost.Post
Set olPost = Nothing

1: How can i change the sender name.
The default user profile is used, and i would like to change only the name.

2:Can i specified another folder instead of use the current folder and then
item.move to the specific folder.

Thanks.
 
The SenderName property is read-only, and resolves to the display name of the
user for the e-mail account or Exchange profile that is being used to post an
item or send an e-mail.

You can set the SentOnBehalfOfName property, but this must resolve to an
entry in your Exchange Global Address List, AND you need to have been
delegated Send As rights for that mailbox.

Another alternative is to create a new message with a different originator,
but this requires CDO:

http://www.cdolive.com/cdo5.htm#MessageOriginator

If you want to post your item to another folder other than the current one,
you'll have to set an explicit reference to the MAPIFolder object for that
folder by walking the NameSpace.Folders collection:

e.g.

Set myFolder = objNS.Folders.Item("Mailbox - jdoe")
Set myInBox = myFolder.Folders("Inbox")
Set myInboxSubFolder = myInbox.Folders("Stuff")
etc.

Note that you don't need to call the Move method, but just call the
Items.Add event for the folder that you obtained as above.
 
Thanks for your help.

But i need more informations.

1st:
I don't want to set a real name of a sender, and i don't have Exchange.
It's a stand alone Outlook.
My goal is just to set a string in that field not a real sender name.
I know it can be done, because some "plugin" do it, but the question is how?!

2nd:CDO is a CNT extension, and i'm not familliar with Outlook
developpement, so i don't have a clue , to what i have to do with this? (to
put it on a exchange server?)

Thanks again for your support.

David
 
You say you don't have Exchange, but you're using a Public Folder??

AFAIK, you cannot alter the sender name to be different than the user
name/address properties that are defined for the account that the e-mail is
being sent through, aside from using delegation.

What do you mean by "CNT extension"?

If you want to program with the CDO library, this is an optional install
during Office setup. More info on programming with CDO are at these links:

http://www.cdolive.com
Using Collaboration Data Objects (CDO) in Microsoft Outlook and Microsoft
Exchange Programming: http://www.outlookcode.com/d/cdo.htm

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
Try Picture Attachments Wizard for Outlook! http://tinyurl.com/ckytm
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/
 
You are once again right.
It's not a "Public Folder", It's just a "simple" folder on my outlook.
I used a wrong terminology.

So, in fact, i just want to create a IPM in a folder with a specific
"Sender" name.


I will take a look in the CDO web site as soon as i understand how to
install it.
So far i did not find in the FAQ.

Best regards and thanks again .
 
Back
Top