kuk1508
Goto Top

MS Artikel-ID 235852 Nur ein bestimmtes Kontos weiterleiten

Hallo zusammen,

ich benötige eure Hilfe.

Im Microsoft Artikel 235852 wird beschrieben, wie ich per Uhrzeitsteuerung eMails bei einem geöffneten Outlook weiterleiten kann. Quasi eine Regel (leider kann diese der Outlook-Regelassistent nicht).

Jetzt habe ich nur ein Problem - auf dem PC, an dem diese Regel angewendet werden soll, gibt es zwei eMail-Konten. Einmal info@... und die zweite heißt callcenter@...

Mit dem oben beschriebenen Script wird der gesamte Posteingang an eine andere eMail-Adresse (im definierten Zeitraum) weitergeleitet - ich benötige aber nur die Weiterleitung eines eMail-Konto´s --> info@... // die callcenter@... soll nicht weitergeleitet werden.

Wie muss dieser Code abgeändert werden?
Public WithEvents myOlItems As Outlook.Items


Public Sub Application_Startup()

' Reference the items in the Inbox. Because myOlItems is declared
' "WithEvents" the ItemAdd event will fire below.
Set myOlItems = Outlook.Session.GetDefaultFolder(olFolderInbox).Items

End Sub


Private Sub myOlItems_ItemAdd(ByVal Item As Object)

' If it's currently not between 10:00 P.M. and 7:00 A.M.
If Time() < #10:00:00 PM# Or Time() > #7:00:00 AM# Then

' Check to make sure it is an Outlook mail message, otherwise
' subsequent code will probably fail depending on what type
' of item it is.
If TypeName(Item) = "MailItem" Then

' Forward the item just received
Set myForward = Item.Forward

' Address the message
myForward.Recipients.Add "emailadresse@mydomain.com"

' Send it
myForward.Send

End If

End If

End Sub

Vielen Dank für die Hilfe.

MfG
Kai

Content-Key: 122878

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

Printed on: April 24, 2024 at 07:04 o'clock