tranministrator
Goto Top

Outlook 2010 Sende Script (Abfrage von welchem Absender - BCC inkludiert) zusammenführen

Ich habe bereits 2 Abfragen für VB und möchte die aber zusammenführen

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
On Error GoTo Err001
Dim objItem As Outlook.MailItem
If Item.Class = olMail Then
If MsgBox("E-Mail als 'Support' versenden?", vbYesNo) = vbYes Then
Set objItem = Item.Copy
objItem.SentOnBehalfOfName = "support@service4work.com"
objItem.Send
Item.Delete
Cancel = True
End If
End If
Exit Sub
Err001:
MsgBox "Ein Fehler ist beim E-Mail Versand aufgetreten!"
End Sub


Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim objMe As Recipient
Set objMe = Item.Recipients.Add("addresse@domain.com")
objMe.Type = olBCC
objMe.Resolve
Set objMe = Nothing
End Sub


Wie schaffe ich es dass wenn auf Ja gedrückt wird dass auch nur dann an BCC fix geschickt wird?
Geht das in einem Script?
Wenn nein gedrückt wird soll ganz normal gesendet werden, ohne BCC und ohne Spezial VON.

Sorry wegen der Formatierung, ich habe nicht herausgefunden wie man das ordentlich darstellen kann.

Danke

Lg

Content-Key: 204983

Url: https://administrator.de/contentid/204983

Printed on: April 26, 2024 at 03:04 o'clock

Member: colinardo
colinardo Apr 15, 2013 updated at 11:31:03 (UTC)
Goto Top
Hallo Transministrator,

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
	On Error GoTo Err001
	Dim objItem As Outlook.MailItem
	If Item.Class = olMail Then
		If MsgBox("E-Mail als 'Support' versenden?", vbYesNo) = vbYes Then  
			Set objItem = Item.Copy
			objItem.SentOnBehalfOfName = "support@service4work.com"  
			Dim objMe As Recipient
			Set objMe = objItem.Recipients.Add("addresse@domain.com")  
			objMe.Type = olBCC
			objMe.Resolve
			objItem.Send
			Item.Delete
			Cancel = True
		Else
			Cancel = False
		End If
	End If
	Exit Sub
	Err001:
	MsgBox "Ein Fehler ist beim E-Mail Versand aufgetreten!"  
End Sub

Zu deiner Frage der Formatierungen hier im Forum :
Formatting instructions in the posts

Grüße Uwe
Member: Tranministrator
Tranministrator Apr 15, 2013 at 11:59:27 (UTC)
Goto Top
Hallo Uwe,

das ging ja flott face-smile

Vielen Dank für deine Bearbeitung und Info! Hat auf Anhieb funktioniert face-smile

Beste Grüße

Robert