R
Ronald van Aalten
Hi,
I try to create a custom view (ol2002, vb6, reference to msxml v.3.0) by
setting the .XML property after retrieving the xml data from a file. Setting
the view.xml propterty keeps generating an error. What can be wrong?
-------------------------------------
Dim oFld As Outlook.MAPIFolder
Dim oView As Outlook.View
Dim oXml As MSXML2.DOMDocument
Dim sXML As String
Set oFld = goNS.GetDefaultFolder(olFolderContacts)
' first I save the .XML property from an existing view to file:
Set oView = oFld.Views("MyView")
Set oXml = New MSXML2.DOMDocument
oXml.loadXML oView.XML
oXml.Save "c:\data\view.xml"
' now I create a new view and try to set the xml property
Set oView = oFld.Views.Add("MyViewNew", olTableView,
olViewSaveOptionAllFoldersOfType)
Set oXml = New MSXML2.DOMDocument
oXml.async = False
oXml.Load("c:\data\view.xml")
oView.XML = oXml.XML '=> runtime error 'Method XML of object
VIEW failed'
I try to create a custom view (ol2002, vb6, reference to msxml v.3.0) by
setting the .XML property after retrieving the xml data from a file. Setting
the view.xml propterty keeps generating an error. What can be wrong?
-------------------------------------
Dim oFld As Outlook.MAPIFolder
Dim oView As Outlook.View
Dim oXml As MSXML2.DOMDocument
Dim sXML As String
Set oFld = goNS.GetDefaultFolder(olFolderContacts)
' first I save the .XML property from an existing view to file:
Set oView = oFld.Views("MyView")
Set oXml = New MSXML2.DOMDocument
oXml.loadXML oView.XML
oXml.Save "c:\data\view.xml"
' now I create a new view and try to set the xml property
Set oView = oFld.Views.Add("MyViewNew", olTableView,
olViewSaveOptionAllFoldersOfType)
Set oXml = New MSXML2.DOMDocument
oXml.async = False
oXml.Load("c:\data\view.xml")
oView.XML = oXml.XML '=> runtime error 'Method XML of object
VIEW failed'