Я получаю сообщение об ошибке во время выполнения для ниже Excel в VBA код для удаления отправители почтыКак удалить почту от отправителей, отправленных элемент из Outlook,
Sub Worksheet_Change(ByVal Target As Range)
Dim PriorVal As String
' For the worksheet AuditLog
With Sheets("AuditLog")
If Selection(1).Value = "" Then
PriorVal = "Blank"
Else
PriorVal = Selection(1).Value
End If
Set OutlookApp = CreateObject("Outlook.Application")
Set OlObjects = OutlookApp.GetNamespace("MAPI")
Set newmsg = OutlookApp.CreateItem(olMailItem)
'add recipients
newmsg.Recipients.Add ("add your mail id")
'add subject
newmsg.Subject = ("AuditLog has a violator") '"," Environ("UserName"), Environ("ComputerName"), & sh.Name "
'add body
newmsg.Body = Application.UserName & " has made changes to the AuditLog _ tab at cell position " & Target(1).Address & ", " & Target(1).Value
newmsg.Display 'display
newmsg.Send 'send message
newmsg.DeleteAfterSubmit = True
End With
Set newmsg = Nothing: Set OutlookApp = Nothing:
End Sub
Здравствуйте, Mrbungle, я пробовал это, но все еще почта доступно под отправленным элементом за одним исключением. Благодаря! – USA