Parsing out a data Island in a FrontPage document using VBA

  • Thread starter Ken Cox [Microsoft MVP]
  • Start date
K

Ken Cox [Microsoft MVP]

I'm trying to use VBA and the FrontPage object model to retrieve data from
an embedded XML dataisland.

In the code below, I can open the file (sample.htm) and get the content of
the HEAD tag. However, the tags collection doesn't pick out the xml tag,
obviously because it isn't seen as an object in the object model.

There's a reference in the documentation to FPHTMLUnknownElement and
IHTMLElement which may provide a solution here, but so far they escape me.

The simple demonstration code appears below.

Thanks for any help,

Ken


Sub GetDataIsland()
Dim pg As WebFile
Set pg = ActiveWeb.RootFolder.Files("sample.htm")
pg.Open
Dim pgwindow
Set pgwindow = ActiveWebWindow.PageWindows("sample.htm")
' Need to parse the XML in here
Set headtag = pgwindow.Document.all.tags("head")
For Each obj In headtag
Debug.Print obj.outerHTML
Next
End Sub

<html>
<head>
<title></title>
<xml>
<MSHelp:TOCTitle Title="The title of the page goes here"/>
<MSHelp:RLTitle Title="The title of the page goes here"/>
<MSHelp:Keyword Index="K" Term="title parsing" />
<MSHelp:Keyword Index="K" Term="xml data" />
</xml>
</head>
<body>
Sample page for parsing the XML Data Island
</body>
</html>
 

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