By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,160 Members | 1,323 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,160 IT Pros & Developers. It's quick & easy.

Strange behavior in Save for HTMLDocument??

P: n/a
TJ
Hi,

Here is what I did...

mshtml.HTMLDocumentClass htc = new mshtml.HTMLDocumentClass();
mshtml.IHTMLDocument4 doc4 = htc;
mshtml.IHTMLDocument2 doc2 = htc;

doc2 = doc4.createDocumentFromUrl("test.html","null");

for(uint i = 0; i < 500 && doc2.readyState != "complete"; i++)
System.Threading.Thread.Sleep(50);

htc = (mshtml.HTMLDocumentClass)doc2.body.document;
mshtml.IHTMLElement spanPH = htc.getElementById("PlaceHolder");
if(spanPH != null)
{
spanPH.innerText = "Embeded String....";
}

UCOMIPersistFile ipf = (UCOMIPersistFile)htc;
ipf.Save("newtest.html",true);

for(uint i = 0; i < 500 && doc2.readyState != "complete"; i++)
System.Threading.Thread.Sleep(50);
Loaded HTML(test.html) is OK.
When I checked the innerHTML value of htc instance, PlaceHolder tag has
"Embeded String..." value correctly. However, the strange thing is that when
I saved back to the "newtest.html" file...the modified value always was lost..
Newtest.html file was always same with test.html..
How do I save back to new html file after changing the original content of
html file?

I've read some positing that set the designMode=on something...However, it
didn't work at all...

If you have any idea about issue, please let me know.

Thanks.

.................................................. ...............................TJ
May 15 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.