Creating Views

  • Thread starter Thread starter Jonathan Parminter
  • Start date Start date
J

Jonathan Parminter

Hi, I found the following code example using msdn. I want
to be able to modify the xml. For example change the group
by and/or apply filter. How do I achieve this in Outlook
2002?

****** code starts ******
Sub GetView()
'Returns a view object

Dim olApp As Outlook.Application
Dim objName As NameSpace
Dim objViews As Views
Dim objView As View

Set olApp = Outlook.Application
Set objName = olApp.GetNamespace("MAPI")
Set objViews = objName.GetDefaultFolder
(olFolderContacts).Views
'Return a view called By Category
Set objView = objViews.Item("By Category")

Debug.Print objView.XML

objView.Apply

End Sub

***** code ends *****

Any ideas or suggestions appreciated :-)

Cheers
Jonathan
 
Well, I can answer this one for myself... I used the debug
window to get a few examples of various filters applied to
views. I then used text functions such as instr() and mid
() to edit a view's xml schema. It seems to work.

Cheers
Jonathan
 
Back
Top