HTML doc save dialog

  • Thread starter Thread starter joseph.inglis
  • Start date Start date
J

joseph.inglis

I have a web browser object on a form which I have set to edit mode and use
the UCOMIConnectionPointContainer interface to hook in and catch events.



All working sweetly.



Except there are instances where i rewrite the Document.Content and the
first keypress results in a default windows "Content has changed, Save"
dialog.



How can I suppress this? This does not happen on my machine here and is only
apparent on clients machine. It did at one point during development many
months ago then stopped so... ive maybe done something my end... but what?



All used .dlls are with the application and were both on .NET 1.1



Tam
 
Thanks for your reply shak... I already do that.

web1.Navigate2(ref o, ref oEmpty, ref oEmpty,ref oEmpty, ref oEmpty);

web1.NavigateComplete2+=new
AxSHDocVw.DWebBrowserEvents2_NavigateComplete2EventHandler(web1_NavigateComp
lete2);

Songs will be sung about the person that can solve this for me ;-)
 
Try using

OLECMDEXECOPT_DONTPROMPTUSER as parameter before saving in ExecWB function.
 
Nope, been around this road. I do have a toolbar and I do have methods for
cut/paste/indent/bullets etc as you describe.

But not for save. Im not doing that.

What im doing is this. Im only actually saving the part inbetween <body>
tags in a database. In order to refresh the page I get a an existing entry
from the database, create a string that represents the entire html document
content and set this to the
HTMLDocumentClass.body.innerHTML

property. I do the reverse and parse out when changing documents. So
essentially its the same document, in fact, totally. This all works smoothly
here but performing this action on the clients machine generates the "Save"
dialog.

Its been driving me nuts for weeks. I hope im being a bit clearer, I should
have been in the first place so I apologise.

Tam
 
Joseph,

Thanks for ellaborating the problem

If you replace or do something with the tags, the modified flag will be set
to true in the HTMLDocumentClass even if its same data, and thats why you
get the save dialog. There is no way to supress them.

To get through with this problem

1. After getting the string from database do not set the string to
body.InnerHTML
2. Instead flush the string to a temprory "test.html", adding proper start
and end html tags.
3. Navigate this temp file using browser component
4. In the document complete event of browser, get the new document again

//refresh the object again
pHTMLDoc = (HTMLDocumentClass)DesignBrowser.Document;

5. Since its a new navigation, the browser will discard the old document,
and you wont get that save dialog.

There are few options still left to try out. Let me know if this doesnt work


Shak
(Houston)
 
Thanks Shakir... that sounds good.

Im right in the middle of something else but as you can be sure, I'll be
doing this in the next couple of hours... will report back then.

regards

Tam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top