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

  • Thread starter Dominique Schroeder
  • 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
 
S

Sue Mosher [MVP-Outlook]

The Restrict method has nothing to do with the display. What version of
Outlook are you using?
 
D

Dominique Schroeder

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
 
S

Sue Mosher [MVP-Outlook]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top