Creating Views

  • Thread starter Jonathan Parminter
  • 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
 
J

Jonathan Parminter

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
 

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