Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problem writing to DocumentHTML inside FrontPage Add-in

Posted on 2002-06-10
4
Medium Priority
?
222 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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

715 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