Outlook2003 Script How to change the sender

B

bbnimda

Hi,

I made my own form, and it generate a formated mail Receipient / CC
/subject / retails etc....

but a wan't to change the sender of the mail , by a ditributioin list in
this case no matter who send the mail, if the recipient answer the mail it
will be sent to all member of th distribution list

Thank's
 
S

Sue Mosher [MVP-Outlook]

You can use the Item.ReplyRecipients collection to control the reply-to address.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
B

bbnimda

Tks a lot sue your answer are very usefull to me

Tryed tu use this but i doesn't work , Sorry i'm new in Vbscript and
VBA

Item.ReplyRecipients = "mydistributionlist"

can your where am I wrong...

tks



"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de news: (e-mail address removed)...
You can use the Item.ReplyRecipients collection to control the reply-to
address.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
S

Sue Mosher [MVP-Outlook]

When in doubt, check the object browser: Press ALt+F11 to open the VBA environment in Outlook, then press F2. Switch from <All Libraries> to Outlook to browse all Outlook objects and their properties, methods, and events. Select any object or member, then press F1 to see its Help topic.

If you did that, you'd learn that ReplyRecipients is a Recipients collection in which you create new items by using the Add method:

Item.ReplyRecipients.Add "mydistributionlist"

In that application, "mydistributionlist" must be an Exchange distribution list with its own distinct email address.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


bbnimda said:
Tks a lot sue your answer are very usefull to me

Tryed tu use this but i doesn't work , Sorry i'm new in Vbscript and
VBA

Item.ReplyRecipients = "mydistributionlist"

can your where am I wrong...

tks



"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le message
de news: (e-mail address removed)...
You can use the Item.ReplyRecipients collection to control the reply-to
address.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


bbnimda said:
Hi,

I made my own form, and it generate a formated mail Receipient / CC
/subject / retails etc....

but a wan't to change the sender of the mail , by a ditributioin list in
this case no matter who send the mail, if the recipient answer the mail it
will be sent to all member of th distribution list

Thank's
 
J

Jonas Svensson

Here's some code that I use:

Dim myOlApp As Outlook.Application
Dim myItem As Outlook.MailItem

Dim colReplyRecips As Recipients
Dim objReplyRecip As Recipient

' Create an Outlook application object
Set myOlApp = New Outlook.Application

' Creates a new MailItem form
Set myItem = myOlApp.CreateItem(olMailItem)

Set colReplyRecips = myItem.ReplyRecipients
Set objReplyRecip = colReplyRecips.Add("(e-mail address removed)")
 
N

news.microsoft.com

Hi i'ts me Again.....

I've done it but it solve only à 50% of my PB

The name of the sender (from ) stay the same one (olivier D) I want to
replace it with (e-mail address removed) and when some one receive a mail
(sent with the new form) he can
only see from: (e-mail address removed) and not from: Olivier.D


For the second part (Reply) it work's fine

Set myReplyRecipient = myItem.replyRecipients.Add(
(e-mail address removed))

when you click Reply the Recipient is (e-mail address removed)


Thank U All


Jonas Svensson said:
Here's some code that I use:

Dim myOlApp As Outlook.Application
Dim myItem As Outlook.MailItem

Dim colReplyRecips As Recipients
Dim objReplyRecip As Recipient

' Create an Outlook application object
Set myOlApp = New Outlook.Application

' Creates a new MailItem form
Set myItem = myOlApp.CreateItem(olMailItem)

Set colReplyRecips = myItem.ReplyRecipients
Set objReplyRecip = colReplyRecips.Add("(e-mail address removed)")
Tks a lot sue your answer are very usefull to me

Tryed tu use this but i doesn't work , Sorry i'm new in Vbscript and
VBA

Item.ReplyRecipients = "mydistributionlist"

can your where am I wrong...

tks



"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message de news: (e-mail address removed)...
You can use the Item.ReplyRecipients collection to control the reply-to
address.
 
S

Sue Mosher [MVP-Outlook]

If these are both separate Exchange mailboxes, you can assign the value of the MailItem.SendOnBehalfOfName property to the name of another mailbox. Otherwise, see
http://www.outlookcode.com/codedetail.aspx?id=889 for various workarounds that might fit your scenario.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


news.microsoft.com said:
Hi i'ts me Again.....

I've done it but it solve only à 50% of my PB

The name of the sender (from ) stay the same one (olivier D) I want to
replace it with (e-mail address removed) and when some one receive a mail
(sent with the new form) he can
only see from: (e-mail address removed) and not from: Olivier.D


For the second part (Reply) it work's fine

Set myReplyRecipient = myItem.replyRecipients.Add(
(e-mail address removed))

when you click Reply the Recipient is (e-mail address removed)


Thank U All


Jonas Svensson said:
Here's some code that I use:

Dim myOlApp As Outlook.Application
Dim myItem As Outlook.MailItem

Dim colReplyRecips As Recipients
Dim objReplyRecip As Recipient

' Create an Outlook application object
Set myOlApp = New Outlook.Application

' Creates a new MailItem form
Set myItem = myOlApp.CreateItem(olMailItem)

Set colReplyRecips = myItem.ReplyRecipients
Set objReplyRecip = colReplyRecips.Add("(e-mail address removed)")
Tks a lot sue your answer are very usefull to me

Tryed tu use this but i doesn't work , Sorry i'm new in Vbscript and
VBA

Item.ReplyRecipients = "mydistributionlist"

can your where am I wrong...

tks



"Sue Mosher [MVP-Outlook]" <[email protected]> a écrit dans le
message de news: (e-mail address removed)...
You can use the Item.ReplyRecipients collection to control the reply-to
address.
 

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