Class, SenderName and Date in Restrict?

  • Thread starter Thread starter Martin Los
  • Start date Start date
M

Martin Los

I want to restrict the Objects in the Inbox with 3
criteria:

1. The Inbox object should NOT come from any of the
following 3 senders ("(e-mail address removed)", (e-mail address removed)"
or (e-mail address removed)");

2. The object needs be received before a certain date and
time (for example before June 28th, 11:00 PM)

3. The object needs to be a MailItem (so ReportItems,
AppointMentItems etc. should be excluded from the restrict
event and NOT be counted).

Questions:

I. How do I construct the Condition to Restrict the Inbox
Items to the 3 criteria?

For example:
strCondition = [ReceivedTime] >= "28/06/2004 11:00 PM" AND
[SenderName] <> ArraySendername(i) AND [Class]
= "olMailItem" ???

II. Can criterium 3 be put into the strCondition? Outlook
help say it cannot. Would that mean using a select case
statement AFTER having done the Restrict? For example:

For each myItem in myRestrictedItems
Select Case TypeName(myItem)
Case "MailItem"
i = i + 1
Else Case
MsgBox "This restricted item is NOT a MailItem"
End Select
Next

TIA

Martin
 
Dear Dmitry

1. How can I find out what kind of string to look for? In
Outlook help I do not find examples.

2. I am thinking of using redemption in the procedure. If
the procedure is run on the computer of a friend, how can
I check to see if he has the redemption.dll installed? (if
not installed then I would have to use the non-redemption
procedure). Is there a boolean function to check for
redemption?

TIA

Martin
-----Original Message-----
Use MessageClass (string) instead of Class.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


I want to restrict the Objects in the Inbox with 3
criteria:

1. The Inbox object should NOT come from any of the
following 3 senders ("(e-mail address removed)", (e-mail address removed)"
or (e-mail address removed)");

2. The object needs be received before a certain date and
time (for example before June 28th, 11:00 PM)

3. The object needs to be a MailItem (so ReportItems,
AppointMentItems etc. should be excluded from the restrict
event and NOT be counted).

Questions:

I. How do I construct the Condition to Restrict the Inbox
Items to the 3 criteria?

For example:
strCondition = [ReceivedTime] >= "28/06/2004 11:00 PM" AND
[SenderName] <> ArraySendername(i) AND [Class]
= "olMailItem" ???

II. Can criterium 3 be put into the strCondition? Outlook
help say it cannot. Would that mean using a select case
statement AFTER having done the Restrict? For example:

For each myItem in myRestrictedItems
Select Case TypeName(myItem)
Case "MailItem"
i = i + 1
Else Case
MsgBox "This restricted item is NOT a MailItem"
End Select
Next

TIA

Martin


.
 
1. Look at the existing messages to figure out what they are - regular
messages: "IPM.Note", contacts: "IPM.Contact", etc.
2. Try to create one of the Redemption objects (e.g.
CreateObject("Redemption.SafeMailItem")). If it is not installed, you'll get
an error..

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Martin Los said:
Dear Dmitry

1. How can I find out what kind of string to look for? In
Outlook help I do not find examples.

2. I am thinking of using redemption in the procedure. If
the procedure is run on the computer of a friend, how can
I check to see if he has the redemption.dll installed? (if
not installed then I would have to use the non-redemption
procedure). Is there a boolean function to check for
redemption?

TIA

Martin
-----Original Message-----
Use MessageClass (string) instead of Class.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


I want to restrict the Objects in the Inbox with 3
criteria:

1. The Inbox object should NOT come from any of the
following 3 senders ("(e-mail address removed)", (e-mail address removed)"
or (e-mail address removed)");

2. The object needs be received before a certain date and
time (for example before June 28th, 11:00 PM)

3. The object needs to be a MailItem (so ReportItems,
AppointMentItems etc. should be excluded from the restrict
event and NOT be counted).

Questions:

I. How do I construct the Condition to Restrict the Inbox
Items to the 3 criteria?

For example:
strCondition = [ReceivedTime] >= "28/06/2004 11:00 PM" AND
[SenderName] <> ArraySendername(i) AND [Class]
= "olMailItem" ???

II. Can criterium 3 be put into the strCondition? Outlook
help say it cannot. Would that mean using a select case
statement AFTER having done the Restrict? For example:

For each myItem in myRestrictedItems
Select Case TypeName(myItem)
Case "MailItem"
i = i + 1
Else Case
MsgBox "This restricted item is NOT a MailItem"
End Select
Next

TIA

Martin


.
 
Thanks for your advice Dmitry!

Martin
-----Original Message-----
1. Look at the existing messages to figure out what they are - regular
messages: "IPM.Note", contacts: "IPM.Contact", etc.
2. Try to create one of the Redemption objects (e.g.
CreateObject("Redemption.SafeMailItem")). If it is not installed, you'll get
an error..

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

Dear Dmitry

1. How can I find out what kind of string to look for? In
Outlook help I do not find examples.

2. I am thinking of using redemption in the procedure. If
the procedure is run on the computer of a friend, how can
I check to see if he has the redemption.dll installed? (if
not installed then I would have to use the non- redemption
procedure). Is there a boolean function to check for
redemption?

TIA

Martin
-----Original Message-----
Use MessageClass (string) instead of Class.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool


"Martin Los" <[email protected]>
wrote
in message
I want to restrict the Objects in the Inbox with 3
criteria:

1. The Inbox object should NOT come from any of the
following 3 senders ("(e-mail address removed)", (e-mail address removed)"
or (e-mail address removed)");

2. The object needs be received before a certain date and
time (for example before June 28th, 11:00 PM)

3. The object needs to be a MailItem (so ReportItems,
AppointMentItems etc. should be excluded from the restrict
event and NOT be counted).

Questions:

I. How do I construct the Condition to Restrict the Inbox
Items to the 3 criteria?

For example:
strCondition = [ReceivedTime] >= "28/06/2004 11:00
PM"
AND
[SenderName] <> ArraySendername(i) AND [Class]
= "olMailItem" ???

II. Can criterium 3 be put into the strCondition? Outlook
help say it cannot. Would that mean using a select case
statement AFTER having done the Restrict? For example:

For each myItem in myRestrictedItems
Select Case TypeName(myItem)
Case "MailItem"
i = i + 1
Else Case
MsgBox "This restricted item is NOT a MailItem"
End Select
Next

TIA

Martin



.


.
 
Back
Top