Re: Parsing out a data Island in a FrontPage document using VBA
- From: "Steve Easton" <admin@xxxxxxxxxxxxx>
- Date: Sun, 15 May 2005 16:21:49 -0400
Ken,
Don't you need to also define the xml tag and then call it by using the headtag as the object.
something like this:
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")
Set xmltag = headtag.Document.all.tags("xml") 'added this line
For Each obj In xmltag 'changed this line.
Debug.Print obj.outerHTML
Next
End Sub
This is off the top of my head so it might need some tweaking
--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed............
........................with a computer
"Ken Cox [Microsoft MVP]" <BANSPAMken_cox@xxxxxxxxxxxx> wrote in message
news:12A59A79-8410-48C5-A679-ABFD0CCB2109@xxxxxxxxxxxxxxxx
> I'm trying to use VBA and the FrontPage object model to retrieve data from
> an embedded XML data island.
>
> 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>
>
>
.
- Follow-Ups:
- Re: Parsing out a data Island in a FrontPage document using VBA
- From: Ken Cox [Microsoft MVP]
- Re: Parsing out a data Island in a FrontPage document using VBA
- References:
- Parsing out a data Island in a FrontPage document using VBA
- From: Ken Cox [Microsoft MVP]
- Parsing out a data Island in a FrontPage document using VBA
- Prev by Date: Re: help with frames and variables, i can not work this out.
- Next by Date: Re: help with frames and variables, i can not work this out.
- Previous by thread: Parsing out a data Island in a FrontPage document using VBA
- Next by thread: Re: Parsing out a data Island in a FrontPage document using VBA
- Index(es):
Relevant Pages
|