전자 메일이 규칙과 함께 전달 된 후 보낸 편지함 폴더에서 전자 메일을 삭제하려고합니다.vba 보낸 폴더에서 전자 메일을 삭제합니다.
나는 다른 게시물에서 "brettdj"코드를 사용하려했는데, Macro to delete an email 코드는 전혀 작동하지 않습니다.
내가 찾고있는 것은 vba 매크로로 규칙을 사용하여 스크립트를 실행할 때 전자 메일을 삭제할 수 있습니다.
내가 미리
전자 메일이 규칙과 함께 전달 된 후 보낸 편지함 폴더에서 전자 메일을 삭제하려고합니다.vba 보낸 폴더에서 전자 메일을 삭제합니다.
나는 다른 게시물에서 "brettdj"코드를 사용하려했는데, Macro to delete an email 코드는 전혀 작동하지 않습니다.
내가 찾고있는 것은 vba 매크로로 규칙을 사용하여 스크립트를 실행할 때 전자 메일을 삭제할 수 있습니다.
내가 미리
에서
덕분에 당신은 당신의 연락처 폴더 (주소록)에 해당 항목이없는 것을 달성 할 수있는 방법 어떤 생각. Recipients
클래스의 Add 메서드는받는 사람의 이름을 받아들입니다. 표시 이름, 별칭 또는받는 사람의 전체 SMTP 전자 메일 주소를 나타내는 문자열 일 수 있습니다.
Sub forwardEmail(itm As Outlook.MailItem)
Dim oExplorer As Outlook.Explorer
Dim oMail As Outlook.MailItem
Dim oOldMail As Outlook.MailItem
Set oExplorer = Application.ActiveExplorer
If oExplorer.Selection.Item(1).Class = olMail Then
Set oOldMail = oExplorer.Selection.Item(1)
Set oMail = oOldMail.Forward
oMail.Recipients.Add "[email protected]"
oMail.Recipients.Item(1).Resolve
If oMail.Recipients.Item(1).Resolved Then
'delete forwarded email from sent items
oMail.DeleteAfterSubmit = True
oMail.Send
'delete original email from inbox
'oOldMail.Delete
Else
MsgBox "Could not resolve " & oMail.Recipients.Item(1).Name
End If
Else
MsgBox "Not a mail item"
End If
End Sub
모든 계정이 동일한 Outlook에 있습니까? – 0m3r
예 모든 Outlook 계정이 동일한 Outlook 세션에서 가져옵니다. – Driven
질문에 대한 대답을 무효로했을 가능성이 있습니다. 사람들은이 행동을 좋아하지 않을 것입니다. 이 질문을 롤백하고 새 질문을하십시오. http://adackoverflow.com/help/someone-answers – niton