![]() |
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
|
|||
|
|||
![]() Does anyone know of a macro which will date and time stamp the subject box of an incoming email? So if I were to get an email with the subject as "- CGTC - Drainage drawing-" I would like the macro to change the subject to "-090802_15:46 CGTC - Drainage drawing-". Todays date with the time. ALSO do the the same for outgoing emails, for example - I want to send an email out and when I create a new email, already waiting in the subject box is "090802_15:46" Todays date with the time. ALSO, sorry - is there any macro out there which will allow me to open an old email and date stamp it (in subject box) with the date and time it was sent or recieved? I know I can open an old email and click into the email and change this manually.... but I need a macro to do it. Thank you for any help at all!!! Glen -- Glen.Cooper ------------------------------------------------------------------------ Glen.Cooper's Profile: http://www.thecodecage.com/forumz/member.php?userid=613 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=121980 |
#2
|
|||
|
|||
![]() To stamp outgoing mails, save this script in ThisOutlookSession Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) If TypeName(Item) = MailItem Then Dim strSubject As String strSubject = Item.Subject Item.Subject = strSubject & " " & Date & " " & Time End If End Sub To stamp incoming mails, save this script in ThisOutlookSession Private Sub Application_NewMailEx(ByVal EntryIDCollection As String) Dim myNameSpace As NameSpace Dim myInbox As Folder Dim myItem As Object Dim strSubject As String Set myNameSpace = Application.GetNamespace("MAPI") Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox) For i = 1 To myInbox.Items.Count Set myItem = myInbox.Items.Item(i) If myItem.EntryID = EntryIDCollection Then Exit For Next strSubject = myItem.Subject myItem.Subject = strSubject & " " & Date & " " & Time myItem.Save End Sub To stamp an old email, save this script in a Module. Run manually after selecting the email Sub Date_Stamp_Subject() Dim myItem As MailItem Dim strsubject As String Set myItem = GetCurrentItem() myItem.Subject = strsubject & " " & Date & " " & Time myItem.Save End Sub Function GetCurrentItem() As Object Dim objApp As Outlook.Application Set objApp = Application On Error Resume Next Select Case TypeName(objApp.ActiveWindow) Case "Explorer" Set GetCurrentItem = objApp.ActiveExplorer.Selection.Item(1) Case "Inspector" Set GetCurrentItem = objApp.ActiveInspector.CurrentItem End Select Set objApp = Nothing End Function Regards, -- rattanjits http://forums.slipstick.com/ |
#3
|
|||
|
|||
![]() Hi Rattanjits! Thank you for the response, but none of that seems to work :-( I have copied and pasted it all into the appropiate areas, and get the error: COMPILE ERROR: EXPECTED: TYPE NAME Can you help at all? -- Glen.Cooper ------------------------------------------------------------------------ Glen.Cooper's Profile: http://www.thecodecage.com/forumz/member.php?userid=613 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=121980 |
#4
|
|||
|
|||
![]()
Try this:
If TypeName(Item) = "MailItem" Then -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Glen.Cooper" wrote in message ... Hi Rattanjits! Thank you for the response, but none of that seems to work :-( I have copied and pasted it all into the appropiate areas, and get the error: COMPILE ERROR: EXPECTED: TYPE NAME Can you help at all? -- Glen.Cooper ------------------------------------------------------------------------ Glen.Cooper's Profile: http://www.thecodecage.com/forumz/member.php?userid=613 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=121980 |
#5
|
|||
|
|||
![]() Hi Ken, Sorry, same error :-( Anything else? Glen -- Glen.Cooper ------------------------------------------------------------------------ Glen.Cooper's Profile: http://www.thecodecage.com/forumz/member.php?userid=613 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=121980 |
#6
|
|||
|
|||
![]()
If this is Outlook 2003 or earlier then change the declaration in
Application_NewMailEx() on the line: Dim myInbox As folder To this: Dim myInbox As MAPIFolder Make sure no lines are showing in red in case any line breaks were added that split lines of code. If that doesn't help then what line is highlighted on the error? This is being put into the Outlook VBA project? -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Glen.Cooper" wrote in message ... Hi Ken, Sorry, same error :-( Anything else? Glen -- Glen.Cooper ------------------------------------------------------------------------ Glen.Cooper's Profile: http://www.thecodecage.com/forumz/member.php?userid=613 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=121980 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How do I find the Incoming and outgoing Mail Server | Lisa | Outlook - Installation | 1 | March 4th 07 12:57 AM |
names of incoming and outgoing mail servers | noname | Outlook Express | 1 | November 19th 06 02:16 AM |
Error Messages with incoming/outgoing mail | Kyle JP | Outlook Express | 6 | November 18th 06 12:19 AM |
Need server name for outgoing and incoming mail | Jerry Robertson | Outlook Express | 2 | August 21st 06 01:27 AM |
Foreign language in the date of my outgoing/incoming messages | Jeffrey Brown | Outlook - Installation | 0 | March 27th 06 11:57 PM |