Problem writing to DocumentHTML inside FrontPage Add-in
Posted on 2002-06-10
I'm stuck trying to manually create a non-HTML file in a FrontPage 2000 web from within an addin. When the addin is activated, the following code runs (non-relevant code removed)
Dim Root As WebFolder
Dim AllFiles As WebFiles
Dim ThisFile As WebFile
Dim ThisPage As PageWindow
Dim ThisDoc As FPHTMLDocument
Set Root = Application.ActiveWeb.RootFolder
Set AllFiles = Root.Files
Set ThisFile = AllFiles.Add("/Whateverfile.xyz", False)
Set ThisPage = ThisFile.Edit(fpPageViewHtml)
Set ThisDoc = ThisPage.Document
ThisDoc.DocumentHTML = "Whatever goes here xyz" ' ***** Fails
Looks fine to me, and works fine - except for the line commented "Fails" above. When I attempt to assign an arbitrary string to the DocumentHTML property, it bombs with "Run time error 70 - Permission Denied". No matter what I do, any attempt to alter the DocumentHTML propery fails with that error. Reading the value of the property is fine - it shows the contents of a FP-created blank HTML page.
Any idea why this is so? DocumentHTML is supposed to be a read/write property, correct? Is there a better way I could go about this?