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

HTML doc save dialog

P: n/a
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

Nov 16 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Instead of using Navigate method, use Navigate2 method in browser object.

--
Shak
(Houston)

"joseph.inglis" <jo***********@btclick.com> wrote in message
news:cb**********@titan.btinternet.com...
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

Nov 16 '05 #2

P: n/a
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_NavigateComplete2Even tHandler(web1_NavigateComp
lete2);

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

"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:u%****************@tk2msftngp13.phx.gbl...
Instead of using Navigate method, use Navigate2 method in browser object.

--
Shak
(Houston)

"joseph.inglis" <jo***********@btclick.com> wrote in message
news:cb**********@titan.btinternet.com...
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


Nov 16 '05 #3

P: n/a
Try using

OLECMDEXECOPT_DONTPROMPTUSER as parameter before saving in ExecWB function.

--
Shak
(Houston)
"joseph.inglis" <jo***********@btclick.com> wrote in message
news:cb**********@titan.btinternet.com...
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_NavigateComplete2Even tHandler(web1_NavigateComp lete2);

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

"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:u%****************@tk2msftngp13.phx.gbl...
Instead of using Navigate method, use Navigate2 method in browser object.

--
Shak
(Houston)

"joseph.inglis" <jo***********@btclick.com> wrote in message
news:cb**********@titan.btinternet.com...
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



Nov 16 '05 #4

P: n/a
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

"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:Om**************@tk2msftngp13.phx.gbl...
Try using

OLECMDEXECOPT_DONTPROMPTUSER as parameter before saving in ExecWB function.
--
Shak
(Houston)
"joseph.inglis" <jo***********@btclick.com> wrote in message
news:cb**********@titan.btinternet.com...
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_NavigateComplete2Even tHandler(web1_NavigateComp
lete2);

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

"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:u%****************@tk2msftngp13.phx.gbl...
Instead of using Navigate method, use Navigate2 method in browser object.
--
Shak
(Houston)

"joseph.inglis" <jo***********@btclick.com> wrote in message
news:cb**********@titan.btinternet.com...
> 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
>
>
>



Nov 16 '05 #5

P: n/a
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)
"joseph.inglis" <jo***********@btclick.com> wrote in message
news:cb**********@sparta.btinternet.com...
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

"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:Om**************@tk2msftngp13.phx.gbl...
Try using

OLECMDEXECOPT_DONTPROMPTUSER as parameter before saving in ExecWB

function.

--
Shak
(Houston)
"joseph.inglis" <jo***********@btclick.com> wrote in message
news:cb**********@titan.btinternet.com...
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_NavigateComplete2Even tHandler(web1_NavigateComp
lete2);

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

"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:u%****************@tk2msftngp13.phx.gbl...
> Instead of using Navigate method, use Navigate2 method in browser

object.
>
> --
> Shak
> (Houston)
>
> "joseph.inglis" <jo***********@btclick.com> wrote in message
> news:cb**********@titan.btinternet.com...
> > 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
> >
> >
> >
>
>



Nov 16 '05 #6

P: n/a
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

"Shakir Hussain" <sh**@nodomain.com> wrote in message
news:eC*************@TK2MSFTNGP10.phx.gbl...
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)
"joseph.inglis" <jo***********@btclick.com> wrote in message
news:cb**********@sparta.btinternet.com...
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

"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:Om**************@tk2msftngp13.phx.gbl...
Try using

OLECMDEXECOPT_DONTPROMPTUSER as parameter before saving in ExecWB

function.

--
Shak
(Houston)
"joseph.inglis" <jo***********@btclick.com> wrote in message
news:cb**********@titan.btinternet.com...
> 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_NavigateComplete2Even tHandler(web1_NavigateComp
> lete2);
>
> Songs will be sung about the person that can solve this for me ;-)
>
>
>
> "Shakir Hussain" <sh**@fakedomain.com> wrote in message
> news:u%****************@tk2msftngp13.phx.gbl...
> > Instead of using Navigate method, use Navigate2 method in browser
object.
> >
> > --
> > Shak
> > (Houston)
> >
> > "joseph.inglis" <jo***********@btclick.com> wrote in message
> > news:cb**********@titan.btinternet.com...
> > > 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
> > >
> > >
> > >
> >
> >
>
>



Nov 16 '05 #7

P: n/a
Ive just discovered assumption is the mother of evils.

Coding as you suggested Shakir reintroduced the bug to my machine. So that
set me to thinking about your previous comment regarding the tags being
changed. In this version, and most recent, the initial url parameter passed
to navigate2 is "about:blank". I then parse the content and do my thing
which works well.

When I've read/wrote a new entry from the database I then parse using the
same methods. The trick there of course was that this way the actual
document never changed... naviagate2 is only ever called once, which is when
the dialog is generated... when the changed flag is true and you navigate to
a new page.

So how could the client be reporting this error? The pest. He was pasting
from an old set of test notes and *had never re-tested it* simply submitting
it as an error.

Shakir, apologies on my part for having you running around on this when in
fact... there was never a problem. Tis my job to also be aware of gotchas
like this... lesson for us all which is why im humbling myself a little and
posting ;-)

Dont trust your clients results to be de-facto. I assumed, as he was
reporting it, that it was one of the 'happens here but not there' bugs that
can be wild to track down. Ive worked on it at least 1 day and felt the need
to mail the list with it.

And all along the client was either working from an older exe or simply
pasting an old bug. Again, thanks for your help Shakir.

Watch them pesky clients... they can fairly generate dummy work if you let
them... as i just did. Ooops.

Tam

changing the content
"joseph.inglis" <jo***********@btclick.com> wrote in message
news:cb**********@hercules.btinternet.com...
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

"Shakir Hussain" <sh**@nodomain.com> wrote in message
news:eC*************@TK2MSFTNGP10.phx.gbl...
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)
"joseph.inglis" <jo***********@btclick.com> wrote in message
news:cb**********@sparta.btinternet.com...
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

"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:Om**************@tk2msftngp13.phx.gbl...
> Try using
>
> OLECMDEXECOPT_DONTPROMPTUSER as parameter before saving in ExecWB
function.
>
> --
> Shak
> (Houston)
>
>
> "joseph.inglis" <jo***********@btclick.com> wrote in message
> news:cb**********@titan.btinternet.com...
> > 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_NavigateComplete2Even tHandler(web1_NavigateComp
> > lete2);
> >
> > Songs will be sung about the person that can solve this for me ;-)
> >
> >
> >
> > "Shakir Hussain" <sh**@fakedomain.com> wrote in message
> > news:u%****************@tk2msftngp13.phx.gbl...
> > > Instead of using Navigate method, use Navigate2 method in browser > object.
> > >
> > > --
> > > Shak
> > > (Houston)
> > >
> > > "joseph.inglis" <jo***********@btclick.com> wrote in message
> > > news:cb**********@titan.btinternet.com...
> > > > 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
> > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 16 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.