Solved

Problem writing to DocumentHTML inside FrontPage Add-in

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

762 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

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now