PC Review


Reply
Thread Tools Rate Thread

Copy Sent Msgs to current folder AND Sent folder

 
 
New Member
Join Date: May 2010
Posts: 1
 
      5th May 2010
I would like to have a copy of the sent message in the Sent folder as well as in the Current folder. I have the following code (borrowed from http://www.kensheppardson.com/2006/0...nt-items-hack/) which does teh 1st part by changing the MailItem.SaveSentMessageFolder to the current folder. However, this is only one of the folders I want. I cannot just copy the message as it has not yet been sent and will stay that way until the application itemsend method finished. Here is the code I am using now in a Class Module. Any help would be appreciated.

Private Sub Application_ItemSend(ByVal myItem As Object, Cancel As Boolean)
'get current folder
If TypeName(myItem) = "MailItem" Then
Dim olApp As Outlook.Application
Dim objNS As Outlook.NameSpace
Dim objFolder As Outlook.Folder
Dim myCopiedItem As Outlook.MailItem
Set olApp = Outlook.Application
Set objNS = olApp.GetNamespace("MAPI")
Set objFolder = olApp.ActiveExplorer.CurrentFolder
Set myItem.SaveSentMessageFolder = objFolder
'copy msg to objFolder
'Set myCopiedItem = myItem.Copy
'myCopiedItem.Move objFolder
'show message in case copied to wrong folder
MsgBox ("Message w/ sub = " & myItem.Subject & " copied to " & objFolder.Name)
End If
End Sub
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Paste a file into a folder with the current dat casan.mike@gmail.com Microsoft Excel Programming 1 28th Oct 2008 04:47 PM
Copy Paste a file into a folder with the current date casan.mike@gmail.com Microsoft Excel Programming 1 28th Oct 2008 04:39 PM
Copy Template Folder and Rename To Current Record dan.cawthorne@gmail.com Microsoft Access Form Coding 0 11th Sep 2007 02:09 PM
Copy workbook to current folder DavidW Microsoft Excel Programming 0 20th Apr 2006 09:53 PM
current user folder is set to the allusers folder; how do I change it back? startup programs being run twice. Hugh Jazz Windows XP Configuration 3 3rd Nov 2004 06:44 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:50 PM.