forward message, keeping original sender name in the field?

  • Thread starter Thread starter Evgen
  • Start date Start date
E

Evgen

Hi to everyone,
Kindly ask for help for the following task. It happens that I receive
messages from the different counterparts and some of these messages forward
regularly to other people in my organization. Those people in my
organization have problem to find or sort these messages as all of them
appear as coming from me.
Is there any way to creatre a code or a form, which will add a field,
storing a name and address of the original mailer for the forwarded messages
and show this field in Outlook for people in my organization.
For example, I get a message from (e-mail address removed) , forward it and
people in my organization get the message like: From: (e-mail address removed) To:
(e-mail address removed) Original poster: (e-mail address removed)

Any help is greatly appreciated!

Evgen
 
Here's one way you can do it.

1) Create a new form based on the default Message class from the Standard
Forms Library. Add two fields to store the information you want (i.e.
SenderName, SenderAddress). Bind them to controls on the form (you can put
them in a hidden Page if you don't want them to be shown), and publish the
form to your Organization Forms Library with whatever name you want (i.e.
IPM.Note.MyForwardForm).

2) Create a macro that you would run that will forward the message you
select in a folder. This new message will use your custom form to add the
information from the original e-mail into the new custom fields:

Sub ForwardSelectedEmailUsingCustomForm()
Dim objForward As Outlook.MailItem, objOrig As Object
Dim objProp As Outlook.UserProperty

If Application.ActiveExplorer.Selection.Count <> 1 Then Exit Sub
Set objOrig = Application.ActiveExplorer.Selection.Item(1)
If objOrig.Class <> olMail Then Exit Sub

Set objForward = objOrig.Forward
objForward.MessageClass = "IPM.Note.Test"
objForward.To = "(e-mail address removed)"
Set objProp = objForward.UserProperties.Add("MyFieldSenderName", olText,
False)
objProp.Value = objOrig.SenderName
Set objProp = objForward.UserProperties.Add("MyFieldSenderAddress",
olText, False)
objProp.Value = objOrig.SenderEmailAddress
objForward.Send

Set objForward = Nothing
Set objOrig = Nothing
Set objProp = Nothing
End Sub

Now instruct your recipients to add the custom fields from the
"IPM.Note.<your custom form name>" form to their Inbox. You might have to
browse to the Organization Forms Library in the Field Chooser Dialog to
select your form and choose your custom fields.

With some tweaking you can alter the macro to automatically fire for
incoming e-mails, or process more than one selected item, etc.
 
Dear Eric,
Many thanks for your help, but I cannot make it working :-(
First, I created a form, based on Standard IPM.Note and added to new
ields -"OriginalSenderName" and "OriginalSenderAddress". I put those fields
on the second page of form and made it hidden.I published the form in
Organization Forms Library on our Exchange 2000, wehere I have an owner
permissions. I named it IPM.Note.OurForwardNote. Other users got either
Publishing editor or Reviewer Permissions for that folder.
I created Sub in General section of ThisOutlookSession Object. Frankly
speaking, I just copied your text (many thanks again!), replacing
"IPM.Note.Test" to "IPM.Note.OurForwardNote" and "MyFieldSenderName" and
"MyFieldSenderAddress" to "OriginalSenderName" and "OriginalSenderAddress"
respectively.
I also put a Macros Security level for my Outlook to Medium level.
My counterpart within our Exchange organization added "OriginalSenderName"
and "OriginalSenderAddress" fields to his Inbox window (from the Published
form). When I forward to him any messages, he gets them, but with no
additional information so those filedsin his Inbox are empty.
I also tried to forward to my-selft. The same result.
When I push forward button in my Outlook and message is ready for forward,
I switched to the Form design view, and dfound that Outlook is using the
standard form instead of the Custom one.

Sorry, but what's is wrong?
Thank you in advance for your help!
Evgen
 
It sounds like you followed my directions precisely, but did you run the
macro against a selected e-mail that you wish to forward? It is the macro
that creates a message using the new custom form.

Check your Sent Items folder for the e-mails that are being forwarded
(provided you have the option to retain copies of forwarded messages in the
Sent Items folder turned on) to verify that they are being sent using the
custom form. To do this, add the Message Class field to the view from the
All Mail Fields category in the Field Chooser dialog. Do this as well on the
recipient's Inbox to verify that the forwarded e-mails they are receiving are
using the new custom form.

If there are still problems, step through the code in the macro and verify
that objForward.MessageClass is not changing to "IPM.Note" before it is being
sent. If it is, it has changed to a one-off form (see
http://www.outlookcode.com/d/formpub.htm#oneoff for more info).

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/
 
Dear Eric,
Thank you again. I simply leaft Outlook and entered it again and everything
started working - but just from within a script itself. :-(
Is there any way to make this form a default one for a "Forward" butto click
action. Is it possible that Macros will allow to select a receiver
interactively as currently a receipine is defined by objForward.To
statement?
The icon for the messages is also "Note". Might it be an Envelope?

Kind regards,
Evgen

PS I removed our previous conversation to save some space and included my
code (actually, yours :-) ) for a reference.
Eric Legault said:
It sounds like you followed my directions precisely, but did you run the

Sub ForwardSelectedEmailUsingCustomForm()
Dim objForward As Outlook.MailItem, objOrig As Object
Dim objProp As Outlook.UserProperty

If Application.ActiveExplorer.Selection.Count <> 1 Then Exit Sub
Set objOrig = Application.ActiveExplorer.Selection.Item(1)
If objOrig.Class <> olMail Then Exit Sub

Set objForward = objOrig.Forward
objForward.MessageClass = "IPM.Note.OurForwardNote"
objForward.To = "(e-mail address removed)"
Set objProp = objForward.UserProperties.Add("OriginalSenderName",
olText, False)
objProp.Value = objOrig.SenderName
Set objProp = objForward.UserProperties.Add("OriginalSenderAddress",
olText, False)
objProp.Value = objOrig.SenderEmailAddress
objForward.Send

Set objForward = Nothing
Set objOrig = Nothing
Set objProp = Nothing
End Sub
 
In order to assign a specific form to use on a custom or default action, the
form that is initiating the action would also have to be a custom form. You
would need to change the default form or change the message class for
existing forms.

See this for more info:

How to make a Microsoft Outlook custom form the default:
http://www.outlookcode.com/d/newdefaultform.htm

If you need to interactively select the recipients to whom you will be
forwarding the item, you would need to use CDO's Session.AddressBook method
to display the Address Book dialog.

You can change the icon for a custom form in the Properties page.

--
Eric Legault - B.A, MCP, MCSD, Outlook MVP
--------------------------------------------------
{Private e-mails ignored}
Job: http://www.imaginets.com
Blog: http://blogs.officezealot.com/legault/
 
Back
Top