Solved

Problem writing to DocumentHTML inside FrontPage Add-in

Posted on 2002-06-10
4
220 Views
Last Modified: 2008-02-01
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
  ThisPage.Close True

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?
0
Comment
Question by:ScottNero
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Expert Comment

by:vblogic
ID: 7068163
I'm not an FP person, but generally speaking you cannot alter the contents of a loaded html file until it is fully loaded.  Are the methods of loading the file synchronous so we know that this is not an issue, or is it asynchronous and perhaps there is some event that you can watch for that tells you if the document has been fully loaded?
0
 
LVL 1

Author Comment

by:ScottNero
ID: 7068174
I don't think that's the problem. I can step through it in the VB debugger, watch it load the file, see the file in the editor, then manually (in the debug window) try to edit the DocumentHTML property, and it still comes up with the same Permission Denied error. I've searched around the web and found a few people who have encountered the same problem, but never an answer - just the problem description.
0
 
LVL 16

Expert Comment

by:twalgrave
ID: 7897276
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
- PAQ'd and points refunded
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

twalgrave
Cleanup Volunteer
0
 

Accepted Solution

by:
SpideyMod earned 0 total points
ID: 7941802
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Get HTML5 Certified

Want to be a web developer? You'll need to know HTML. Prepare for HTML5 certification by enrolling in July's Course of the Month! It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month11 days, 16 hours left to enroll

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question