Creating webview folders inside a folder

W

Water Cooler v2

I am creating a heirarchy of sub-folders, each with a web view and a
web url.

It all works fine for the main top level folder. However, when I click
on the sub folders, they do not have their web view on. Nor do they
have a web url in their properties. What gives?

Here's the code.



Private Sub Login()
Dim lSettings As Settings = GetPersistedSettings()
Dim nm As Outlook.NameSpace
Dim folders As Outlook.Folders
Dim fldfoo As Outlook.MAPIFolder
Dim exp As Outlook.Explorer

nm = applicationObject.GetNamespace("MAPI")
nm.AddStore("foo.pst")
fldfoo = nm.Folders.GetLast()
fldfoo.Name = "foo"
fldfoo.WebViewOn = True
fldfoo.WebViewURL = "http://test.foo.com/login2.jsp?userId=" &
lSettings.UserName & "&password=" & lSettings.Password
fldfoo.WebViewAllowNavigation = True
exp = CType(applicationObject,
Outlook.Application).ActiveExplorer
Log.Write("Set the exp object to the active explorer in
Outlook")
exp.CurrentFolder = fldfoo
Log.Write("Set the newly created foo folder as the current
folder in the active explorer")
Call CreateSubFolders(fldfoo)

End Sub

Private Sub CreateSubFolders(ByVal fldfoo As Outlook.MAPIFolder)
Dim doc As XmlDocument = New XmlDocument
doc.Load("http://support.foo.com/uitabs.xml")
Log.Write("Loaded XML doc")
If doc Is Nothing Then Exit Sub
Log.Write("XML doc has content")
Call CreateSubFolder(doc.DocumentElement, fldfoo)
Log.Write("finished creating folder heirarchy")
doc = Nothing
End Sub

Private Sub CreateSubFolder(ByVal ndParent As XmlNode, ByVal
fldParent As Outlook.MAPIFolder)

Log.Write("Entered CreateSubFolder")
For Each nd As XmlNode In ndParent.ChildNodes
If TypeOf nd Is XmlElement Then
If nd.Name = "uitab" Then
Log.Write("For Each nd As XmlNode In nd.ChildNodes:
" & nd.Name)
If Not nd.Attributes Is Nothing Then
Log.Write("If nd.Attributes.Count > 0 Then")
If (Not (nd.Attributes("display") Is Nothing))
Then
Log.Write("nd " &
nd.Attributes("display").Value)
Dim fldNew As Outlook.MAPIFolder =
fldParent.Folders.Add(nd.Attributes("display").Value)
Log.Write("Created a new MAPI Folder: " &
nd.Attributes("display").Value)

fldNew.WebViewOn = True
fldNew.WebViewURL =
nd.Attributes("href").Value
Dim StrURL As String =
nd.Attributes("href").Value
Log.Write(StrURL)
fldNew.WebViewAllowNavigation = True

Log.Write("Set the description")
If nd.HasChildNodes Then
Log.Write("nd has child nodes")
Call CreateSubFolder(nd, fldNew)
End If
End If
End If
End If
End If
Next
End Sub
 

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