copy sended message in other folder...

User avatar
sal21
PlatinumLounger
Posts: 4368
Joined: 26 Apr 2010, 17:36

copy sended message in other folder...

Post by sal21 »

My code:

Code: Select all


Private Sub INVIO_EMAIL(cc, D1)

    Dim objApp As Outlook.Application
    Dim objMsg As Outlook.MailItem
    Dim FSO As FileSystemObject
    Dim TS As Object
    Dim strText As String

    Set objApp = CreateObject("Outlook.Application")
    Set objMsg = objApp.CreateItem(olMailItem)

    Set FSO = CreateObject("Scripting.FileSystemObject")
    Set TS = FSO.OpenTextFile("C:\ASS_MF\TESTO_EMAIL.txt", ForReading)
    strText = TS.ReadAll

    With objMsg
        .SentOnBehalfOfName = "KYC_Retail"
        .To = DAG
        .CC = cc '& ";" & D1
        .Subject = "MI FU"
        .Body = strText
       ' .Display
        .Send
    End With

    Set objApp = Nothing
    Set objMsg = Nothing
    Set FSO = Nothing
    Set TS = Nothing

End Sub
with this code i send a message... automaticlly a copy of this e-mail is saved in to "posta inviata" to the default.
In my case is possible, without a otolook rule, to save a copy into folder Sal21, instead "Posta Inviata", ?????

User avatar
HansV
Administrator
Posts: 78615
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: copy sended message in other fofolder...

Post by HansV »

As far as I know, that is not possible. You'd have to move the item after it has been sent, but it's tricky to do that in the same macro that sends it.
Best wishes,
Hans