OVC .Restriction property syntax?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Can anyone help me with the syntax for using the Outlook View Control's
..Restriction property?

I have the control in a very simple form based on IPM.Note in Outlook2003.

My code includes the following:

Private objFolderPath
Private objView
Private strJobNo

objFolderPath = "\\Public Folders\All Public Folders\Vaughan\Minutes"
objView = '"Outstanding Minutes"

Sub Item_Open
strJobNo = Item.UserProperties("Job").Value
Set myView = _
Item.GetInspector.ModifiedFormPages("Minutes").Controls("ViewCtl1")
With myView
.Folder = objFolderPath
.View = objView
.Restriction "[Job] = " & strJobNo
End With
End Sub

This works fine with the .Restriction statement commented out, but with it
in, I get the following script error:

Object doesn't support this property or method: 'Restriction'
Line no:12

I have read and re-read the Outlook view control reference and can't see
what I'm doing wrong. Can anyone help at all?

Thanks in advance

Vaughan
 
This trick of writing to the forum never fails. Just after posting the
question I tried it with "=" between .Restriction and the criteria statement
and it worked a treat. :)

I have to say, though, that the reference is wrong on the point.
 
Back
Top