OVC .Restriction property syntax?

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
 
G

Guest

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.
 

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