Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Redirect email from Sent folder (http://www.outlookbanter.com/outlook-vba/13149-redirect-email-sent-folder.html)

Christine April 28th 06 09:57 PM

Redirect email from Sent folder
 
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

Michael Bauer April 30th 06 09:59 AM

Redirect email from Sent folder
 
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?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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


Christine May 1st 06 04:07 PM

Redirect email from Sent folder
 
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

"Michael Bauer" wrote:

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?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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



Michael Bauer May 2nd 06 07:22 AM

Redirect email from Sent folder
 
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.


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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

"Michael Bauer" wrote:

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?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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



Christine May 2nd 06 10:42 PM

Redirect email from Sent folder
 
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

"Michael Bauer" wrote:

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.


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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

"Michael Bauer" wrote:

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?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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



Michael Bauer May 3rd 06 07:01 AM

Redirect email from Sent folder
 
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(olFolderSentM ail).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 = "

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

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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

"Michael Bauer" wrote:

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.


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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

"Michael Bauer" wrote:

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?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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



Christine May 4th 06 06:34 PM

Redirect email from Sent folder
 
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

"Michael Bauer" wrote:

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(olFolderSentM ail).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 = "

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

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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

"Michael Bauer" wrote:

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.


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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

"Michael Bauer" wrote:

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?

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
-- www.vbOffice.net --


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





All times are GMT +1. The time now is 08:48 PM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com