E-mails respondidos pelo script VBA não mostram o ícone de resposta com a seta roxa

0

Eu tenho um script VBA que move um email para uma pasta (caixa de diálogo) e gera uma resposta que será salva na mesma pasta. O problema que estou tendo é o e-mail original nunca mostra o ícone de resposta com a seta roxa. Alguma idéia do que estou perdendo?

Sub FileAndReply()
'This subroutine will move the highlighted email to a user selected folder
'and generate a reply that will be saved in the same folder.
'PROBABLY: Must have Save copy of messages in Sent folder set.
'MAYBE: Must have When replying to a message that is not in the Inbox, save...

Dim olApp As New Outlook.Application
Dim olExp As Outlook.Explorer
Dim olSel As Outlook.Selection
Dim olNS As Outlook.NameSpace
Dim olFolder As Outlook.Folder
Dim olItem As Outlook.MailItem

Set olExp = olApp.ActiveExplorer
Set olSel = olExp.Selection
Set olNS = olApp.GetNamespace("MAPI")

'get folder user wants to put email in
Set olFolder = olNS.PickFolder

If TypeName(olFolder) <> "Nothing" Then
    olSel.Item(1).Move olFolder
    Set olItem = olSel.Item(1).Reply

    'TO BE FIXED: reply object is created, but original message does
    'not get the icon showing replied to purple arrow!

    Set olItem.SaveSentMessageFolder = olFolder
    olItem.Display
Else
    MsgBox ("No folder selected.  Script aborted.")
End If
End Sub
    
por Scott 20.04.2016 / 22:25

1 resposta

0

Quando você move um item, um novo item é criado. Você precisa fazer a resposta no novo item.

Sub FileAndReply()
'This subroutine will move the highlighted email to a user selected folder
'and generate a reply that will be saved in the same folder.
'PROBABLY: Must have Save copy of messages in Sent folder set.
'MAYBE: Must have When replying to a message that is not in the Inbox, save...

Dim olApp As New Outlook.Application
Dim olExp As Outlook.Explorer
Dim olSel As Outlook.Selection
Dim olNS As Outlook.NameSpace
Dim olFolder As Outlook.folder
Dim olItem As Outlook.MailItem

Set olExp = olApp.ActiveExplorer
Set olSel = olExp.Selection
Set olItem = olSel.Item(1)

Set olNS = olApp.GetNamespace("MAPI")

'get folder user wants to put email in
Set olFolder = olNS.PickFolder

If TypeName(olFolder) <> "Nothing" Then
    Set olItem = olItem.Move(olFolder)

    Set olItem = olItem.Reply

    'TO BE FIXED: reply object is created, but original message does
    'not get the icon showing replied to purple arrow!

    Set olItem.SaveSentMessageFolder = olFolder
    olItem.Display
Else
    MsgBox ("No folder selected.  Script aborted.")
End If
End Sub
    
por 20.04.2016 / 22:31