A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How do i add the date to subject header of incoming mail?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 1st 10, 07:47 AM posted to microsoft.public.outlook.program_vba
primed
external usenet poster
 
Posts: 5
Default How do i add the date to subject header of incoming mail?

Hi,

How do i automatically add the date yy/mm/dd to the front of the subject
header of incoming mail? Would gather its something to do with create rules
then run script, but cant workout how to create a script.

Thanks
Primed
Ads
  #2  
Old April 1st 10, 09:13 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default How do i add the date to subject header of incoming mail?



The script that can be run by a rule must look like this:

Public Sub Whatever(Mail as Outlook)
Mail.Subject=Date & " " & Mail.Subject
Mail.Save
End Sub

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Wed, 31 Mar 2010 22:47:01 -0700 schrieb primed:

Hi,

How do i automatically add the date yy/mm/dd to the front of the subject
header of incoming mail? Would gather its something to do with create

rules
then run script, but cant workout how to create a script.

Thanks
Primed

  #3  
Old April 6th 10, 02:41 AM posted to microsoft.public.outlook.program_vba
primed
external usenet poster
 
Posts: 5
Default How do i add the date to subject header of incoming mail?

Hi Michael,

It came up with a run error.
Any ideas?

Thanks
Primed

"Michael Bauer [MVP - Outlook]" wrote:



The script that can be run by a rule must look like this:

Public Sub Whatever(Mail as Outlook)
Mail.Subject=Date & " " & Mail.Subject
Mail.Save
End Sub

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Wed, 31 Mar 2010 22:47:01 -0700 schrieb primed:

Hi,

How do i automatically add the date yy/mm/dd to the front of the subject
header of incoming mail? Would gather its something to do with create

rules
then run script, but cant workout how to create a script.

Thanks
Primed

.

  #4  
Old April 6th 10, 09:13 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default How do i add the date to subject header of incoming mail?


Sorry, the first line should look like this:

Public Sub Whatever(Mail as Outlook.MailItem)

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Mon, 5 Apr 2010 17:41:02 -0700 schrieb primed:

Hi Michael,

It came up with a run error.
Any ideas?

Thanks
Primed

"Michael Bauer [MVP - Outlook]" wrote:



The script that can be run by a rule must look like this:

Public Sub Whatever(Mail as Outlook)
Mail.Subject=Date & " " & Mail.Subject
Mail.Save
End Sub

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Wed, 31 Mar 2010 22:47:01 -0700 schrieb primed:

Hi,

How do i automatically add the date yy/mm/dd to the front of the subject
header of incoming mail? Would gather its something to do with create

rules
then run script, but cant workout how to create a script.

Thanks
Primed

.

  #5  
Old April 7th 10, 02:03 AM posted to microsoft.public.outlook.program_vba
primed
external usenet poster
 
Posts: 5
Default How do i add the date to subject header of incoming mail?

Cheers, that works better.
Can the date be reversed so its like this 100407


Also can the files attached to the document be renamed to have the same date
before them.

Thanks
Primed

"Michael Bauer [MVP - Outlook]" wrote:


Sorry, the first line should look like this:

Public Sub Whatever(Mail as Outlook.MailItem)

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Mon, 5 Apr 2010 17:41:02 -0700 schrieb primed:

Hi Michael,

It came up with a run error.
Any ideas?

Thanks
Primed

"Michael Bauer [MVP - Outlook]" wrote:



The script that can be run by a rule must look like this:

Public Sub Whatever(Mail as Outlook)
Mail.Subject=Date & " " & Mail.Subject
Mail.Save
End Sub

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Wed, 31 Mar 2010 22:47:01 -0700 schrieb primed:

Hi,

How do i automatically add the date yy/mm/dd to the front of the subject
header of incoming mail? Would gather its something to do with create
rules
then run script, but cant workout how to create a script.

Thanks
Primed
.

.

  #6  
Old April 7th 10, 03:01 AM posted to microsoft.public.outlook.program_vba
primed
external usenet poster
 
Posts: 5
Default How do i add the date to subject header of incoming mail?

The script doesnt run when the rule is initiated automatically. ie
when the mail comes in. The other aspects of the rule work just not the
script.

When i run the rule manually, through the apply rule to existing mail tick
box everything works good.

Any ideas?

"Michael Bauer [MVP - Outlook]" wrote:


Sorry, the first line should look like this:

Public Sub Whatever(Mail as Outlook.MailItem)

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Mon, 5 Apr 2010 17:41:02 -0700 schrieb primed:

Hi Michael,

It came up with a run error.
Any ideas?

Thanks
Primed

"Michael Bauer [MVP - Outlook]" wrote:



The script that can be run by a rule must look like this:

Public Sub Whatever(Mail as Outlook)
Mail.Subject=Date & " " & Mail.Subject
Mail.Save
End Sub

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Wed, 31 Mar 2010 22:47:01 -0700 schrieb primed:

Hi,

How do i automatically add the date yy/mm/dd to the front of the subject
header of incoming mail? Would gather its something to do with create
rules
then run script, but cant workout how to create a script.

Thanks
Primed
.

.

  #7  
Old April 7th 10, 09:30 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default How do i add the date to subject header of incoming mail?



1) See the Format function.

2) I've never tried it, but AFAIK you can't rename an attached file, instead
you'd have first to rename the file, then attach it. For that you could
monitor AttachmentAdd function: If you detect a file has been attached, save
it as a file, remove it from the email, rename the file, and attach it
again.

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Tue, 6 Apr 2010 17:03:01 -0700 schrieb primed:

Cheers, that works better.
Can the date be reversed so its like this 100407


Also can the files attached to the document be renamed to have the same

date
before them.

Thanks
Primed

"Michael Bauer [MVP - Outlook]" wrote:


Sorry, the first line should look like this:

Public Sub Whatever(Mail as Outlook.MailItem)

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Mon, 5 Apr 2010 17:41:02 -0700 schrieb primed:

Hi Michael,

It came up with a run error.
Any ideas?

Thanks
Primed

"Michael Bauer [MVP - Outlook]" wrote:



The script that can be run by a rule must look like this:

Public Sub Whatever(Mail as Outlook)
Mail.Subject=Date & " " & Mail.Subject
Mail.Save
End Sub

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Wed, 31 Mar 2010 22:47:01 -0700 schrieb primed:

Hi,

How do i automatically add the date yy/mm/dd to the front of the

subject
header of incoming mail? Would gather its something to do with create
rules
then run script, but cant workout how to create a script.

Thanks
Primed
.

.

  #8  
Old April 7th 10, 09:37 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default How do i add the date to subject header of incoming mail?



Maybe there's another rule working on the received message for that you have
set the "don't execute more rules" action?

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en

Am Tue, 6 Apr 2010 18:01:01 -0700 schrieb primed:

The script doesnt run when the rule is initiated automatically. ie
when the mail comes in. The other aspects of the rule work just not the
script.

When i run the rule manually, through the apply rule to existing mail tick
box everything works good.

Any ideas?

"Michael Bauer [MVP - Outlook]" wrote:


Sorry, the first line should look like this:

Public Sub Whatever(Mail as Outlook.MailItem)

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Mon, 5 Apr 2010 17:41:02 -0700 schrieb primed:

Hi Michael,

It came up with a run error.
Any ideas?

Thanks
Primed

"Michael Bauer [MVP - Outlook]" wrote:



The script that can be run by a rule must look like this:

Public Sub Whatever(Mail as Outlook)
Mail.Subject=Date & " " & Mail.Subject
Mail.Save
End Sub

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Wed, 31 Mar 2010 22:47:01 -0700 schrieb primed:

Hi,

How do i automatically add the date yy/mm/dd to the front of the

subject
header of incoming mail? Would gather its something to do with create
rules
then run script, but cant workout how to create a script.

Thanks
Primed
.

.

  #9  
Old April 8th 10, 02:13 AM posted to microsoft.public.outlook.program_vba
primed
external usenet poster
 
Posts: 5
Default How do i add the date to subject header of incoming mail?

Hi Michael,

1) Looked there but it didnt seem to give me the answer i was after.

"Michael Bauer [MVP - Outlook]" wrote:



1) See the Format function.

2) I've never tried it, but AFAIK you can't rename an attached file, instead
you'd have first to rename the file, then attach it. For that you could
monitor AttachmentAdd function: If you detect a file has been attached, save
it as a file, remove it from the email, rename the file, and attach it
again.

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Tue, 6 Apr 2010 17:03:01 -0700 schrieb primed:

Cheers, that works better.
Can the date be reversed so its like this 100407


Also can the files attached to the document be renamed to have the same

date
before them.

Thanks
Primed

"Michael Bauer [MVP - Outlook]" wrote:


Sorry, the first line should look like this:

Public Sub Whatever(Mail as Outlook.MailItem)

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Mon, 5 Apr 2010 17:41:02 -0700 schrieb primed:

Hi Michael,

It came up with a run error.
Any ideas?

Thanks
Primed

"Michael Bauer [MVP - Outlook]" wrote:



The script that can be run by a rule must look like this:

Public Sub Whatever(Mail as Outlook)
Mail.Subject=Date & " " & Mail.Subject
Mail.Save
End Sub

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Wed, 31 Mar 2010 22:47:01 -0700 schrieb primed:

Hi,

How do i automatically add the date yy/mm/dd to the front of the

subject
header of incoming mail? Would gather its something to do with create
rules
then run script, but cant workout how to create a script.

Thanks
Primed
.

.

.

  #10  
Old April 8th 10, 09:21 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default How do i add the date to subject header of incoming mail?



To that function you can pass the format you want, use YY for a two digit
year, YYYY for a four digit year, etc.

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Wed, 7 Apr 2010 17:13:01 -0700 schrieb primed:

Hi Michael,

1) Looked there but it didnt seem to give me the answer i was after.

"Michael Bauer [MVP - Outlook]" wrote:



1) See the Format function.

2) I've never tried it, but AFAIK you can't rename an attached file,

instead
you'd have first to rename the file, then attach it. For that you could
monitor AttachmentAdd function: If you detect a file has been attached,

save
it as a file, remove it from the email, rename the file, and attach it
again.

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Tue, 6 Apr 2010 17:03:01 -0700 schrieb primed:

Cheers, that works better.
Can the date be reversed so its like this 100407


Also can the files attached to the document be renamed to have the same

date
before them.

Thanks
Primed

"Michael Bauer [MVP - Outlook]" wrote:


Sorry, the first line should look like this:

Public Sub Whatever(Mail as Outlook.MailItem)

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Mon, 5 Apr 2010 17:41:02 -0700 schrieb primed:

Hi Michael,

It came up with a run error.
Any ideas?

Thanks
Primed

"Michael Bauer [MVP - Outlook]" wrote:



The script that can be run by a rule must look like this:

Public Sub Whatever(Mail as Outlook)
Mail.Subject=Date & " " & Mail.Subject
Mail.Save
End Sub

--
Best regards
Michael Bauer - MVP Outlook
Category Manager - Manage and share your categories:
SAM - The Sending Account Manager:
http://www.vboffice.net/product.html?lang=en


Am Wed, 31 Mar 2010 22:47:01 -0700 schrieb primed:

Hi,

How do i automatically add the date yy/mm/dd to the front of the

subject
header of incoming mail? Would gather its something to do with

create
rules
then run script, but cant workout how to create a script.

Thanks
Primed
.

.

.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Stamp in SUBJECT BOX of Outgoing/Incoming Mail Glen.Cooper Outlook and VBA 12 December 15th 14 07:24 PM
Date AND time on incoming mail messages R Dias Outlook - Installation 3 March 6th 07 07:10 AM
How do I script to change the subject line of incoming mail? D-Man Outlook and VBA 3 January 29th 07 08:12 PM
How do I move the date field in an e-mail header? Kozak & Gayer Outlook - Using Forms 1 July 25th 06 10:24 PM
Save incoming e-mail as msg with name = sent date Ed_Berez Outlook and VBA 1 April 6th 06 07:33 AM


All times are GMT +1. The time now is 08:13 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-2025 Outlook Banter.
The comments are property of their posters.