How to display a filtered view of a calendar (programmatically)

  • Thread starter Thread starter Dominique Schroeder
  • Start date Start date
D

Dominique Schroeder

Hi,

I'm trying to display a calendar that shows me a filtered view for items as
of 01/01/2004.

I thought the following code would achieve this but it doesn't work. It
still lists all entries including those after 01/01/2004.

Any advise is appreciated.

thanks,

Dominique


Public Sub DisplayLast2Weeks()

Dim oFolder As Object
Dim oItems As Object


Set oFolder = Application.GetNamespace("MAPI").GetDefaultFolder(9)
Set oItems = oFolder.Items

oItems.Restrict ("[Start] < '01/01/2004'")
oItems.Parent.Display


Set oCalendarFolder = Nothing
Set oFolder = Nothing
End Sub
 
The Restrict method has nothing to do with the display. What version of
Outlook are you using?
 
version 2000 sr1,

Dominique
Sue Mosher said:
The Restrict method has nothing to do with the display. What version of
Outlook are you using?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Dominique Schroeder said:
Hi,

I'm trying to display a calendar that shows me a filtered view for items as
of 01/01/2004.

I thought the following code would achieve this but it doesn't work. It
still lists all entries including those after 01/01/2004.

Any advise is appreciated.

thanks,

Dominique


Public Sub DisplayLast2Weeks()

Dim oFolder As Object
Dim oItems As Object


Set oFolder = Application.GetNamespace("MAPI").GetDefaultFolder(9)
Set oItems = oFolder.Items

oItems.Restrict ("[Start] < '01/01/2004'")
oItems.Parent.Display


Set oCalendarFolder = Nothing
Set oFolder = Nothing
End Sub
 
There is no solution for your task in Outlook 2000.
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers



Dominique Schroeder said:
version 2000 sr1,

Dominique
Sue Mosher said:
The Restrict method has nothing to do with the display. What version of
Outlook are you using?

Dominique Schroeder said:
Hi,

I'm trying to display a calendar that shows me a filtered view for
items
as
of 01/01/2004.

I thought the following code would achieve this but it doesn't work. It
still lists all entries including those after 01/01/2004.

Any advise is appreciated.

thanks,

Dominique


Public Sub DisplayLast2Weeks()

Dim oFolder As Object
Dim oItems As Object


Set oFolder = Application.GetNamespace("MAPI").GetDefaultFolder(9)
Set oItems = oFolder.Items

oItems.Restrict ("[Start] < '01/01/2004'")
oItems.Parent.Display


Set oCalendarFolder = Nothing
Set oFolder = Nothing
End Sub
 
Back
Top