![]() |
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. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]() 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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]() 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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]() 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
|
|||
|
|||
![]() 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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
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 |