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
  #11  
Old May 7th 10, 11:47 AM
DarrenD DarrenD is offline
Junior Member
 
First recorded activity at Outlookbanter: Dec 2009
Location: Manchester UK
Posts: 3
Default

Hi

i've never created a script before and hope i have done it correctly

i opened ToolMacroVisual Basic Editor
inserted a new module
copied in

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

and saved

then in ToolsRules and Alerts and created a new rule

Apply this rule after the message arrives
on this machine only
run Project1.Whatever

i ran it on my inbox an sent myself an email and nothing happens

im on office outlook 2003 SP2

many thanks
Darren
Ads
  #12  
Old May 11th 10, 11:02 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?


Does it make a difference if you move the code from the module to
ThisOutlookSession? (Don't forget to edit the rule, too.)

If not, set a breakpoint (f9) on the first line of code. Does the code
execution stopps there when a new message arrives?

--
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 Fri, 7 May 2010 10:47:41 +0100 schrieb DarrenD:

Hi

i've never created a script before and hope i have done it correctly

i opened ToolMacroVisual Basic Editor
inserted a new module
copied in

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

and saved

then in ToolsRules and Alerts and created a new rule

Apply this rule after the message arrives
on this machine only
run Project1.Whatever

i ran it on my inbox an sent myself an email and nothing happens

im on office outlook 2003 SP2

many thanks
Darren

  #13  
Old May 14th 10, 05:42 PM
DarrenD DarrenD is offline
Junior Member
 
First recorded activity at Outlookbanter: Dec 2009
Location: Manchester UK
Posts: 3
Default

I have copied it to the ThisOutlookSession and created a new rule to pick it up

i set the breakpoint on the line
Mail.Subject = Date & " " & Mail.Subject

sent a couple of emails to the account and they still got delivered without any date in the subject bar



Quote:
Originally Posted by Michael Bauer [MVP - Outlook] View Post
Does it make a difference if you move the code from the module to
ThisOutlookSession? (Don't forget to edit the rule, too.)

If not, set a breakpoint (f9) on the first line of code. Does the code
execution stopps there when a new message arrives?

--
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 Fri, 7 May 2010 10:47:41 +0100 schrieb DarrenD:

Hi

i've never created a script before and hope i have done it correctly

i opened ToolMacroVisual Basic Editor
inserted a new module
copied in

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

and saved

then in ToolsRules and Alerts and created a new rule

Apply this rule after the message arrives
on this machine only
run Project1.Whatever

i ran it on my inbox an sent myself an email and nothing happens

im on office outlook 2003 SP2

many thanks
Darren
  #14  
Old May 16th 10, 10:31 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?



So the code execution doesn't stop there? Then check Tools/Macros/Security,
whether VBA is executed at all.

--
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 Fri, 14 May 2010 16:42:29 +0100 schrieb DarrenD:

I have copied it to the ThisOutlookSession and created a new rule to
pick it up

i set the breakpoint on the line
Mail.Subject = Date & " " & Mail.Subject

sent a couple of emails to the account and they still got delivered
without any date in the subject bar



'Michael Bauer [MVP - Outlook Wrote:
;348674']Does it make a difference if you move the code from the module
to
ThisOutlookSession? (Don't forget to edit the rule, too.)

If not, set a breakpoint (f9) on the first line of code. Does the code
execution stopps there when a new message arrives?

--
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 Fri, 7 May 2010 10:47:41 +0100 schrieb DarrenD:
-
Hi

i've never created a script before and hope i have done it correctly

i opened ToolMacroVisual Basic Editor
inserted a new module
copied in

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

and saved

then in ToolsRules and Alerts and created a new rule

Apply this rule after the message arrives
on this machine only
run Project1.Whatever

i ran it on my inbox an sent myself an email and nothing happens

im on office outlook 2003 SP2

many thanks
Darren-

 




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:11 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.