Replacing an entire html file

J

Justin Newitter

I wrote a macro that goes through a web and opens each
file into a string variable. From there the program makes
many modifications to the html in the string var. Now I
want to take the variable which contains all of the html
code for the page and use it to replace the old html on
the page. (basically: My_page=My_var)

So far the closest I have been able to come is to save my
variable to my harddrive, and add it to the web using:
Set tempdoc = ActiveWebWindow.PageWindows.Add
("C:\temp.html")

Then I do tempdoc.SaveAs... the original document.

This works except all of my images that have relative
paths that get messed up. Frontpage puts a file:// at
the beginning of them. (Example: <IMG
src="file:///../../images/myimage.gif">)

This seems like it should be something easy to do, but I
have been unable to find a solution. All I want to do is
to be able to set my html page equal to a variable and
save. Any help would be greatly appreciated.

Thanks,
Justin Newitter
 
J

Jim Cheshire

Set the documentHTML property to your HTML string.

ActivePageWindow.ActiveDocument.DocumentHTML = my_var

--
Jim Cheshire
Jimco Add-ins
Add-ins for FrontPage 2000-2003
http://www.jimcoaddins.com
===============================
Co-author of Special Edition
Using Microsoft FrontPage 2003
 
J

Jim Cheshire

If FrontPage opens a file in HTML view, it means that it can't correctly
parse the HTML.

--
Jim Cheshire
Jimco Add-ins
Add-ins for FrontPage 2000-2003
http://www.jimcoaddins.com
===============================
Co-author of Special Edition
Using Microsoft FrontPage 2003
 

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