Solved

Problem writing to DocumentHTML inside FrontPage Add-in

Posted on 2002-06-10
4
219 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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…

739 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