473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

HTML doc save dialog

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
7 3665
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Richard | last post by:
Hi I'm new to ASP/Web programming so any help would be appreciated... Situation: On my web page I would like to present a link {or button} that would allow the user to download a large file. ...
1
by: A B | last post by:
Hello, I have the following two lines in my VB.NET code to cause a datagrid to output in Excel format: Response.ContentType = "application/vnd.ms-excel"...
0
by: Dune | last post by:
Hi there, I have an aspx page that allows users to enter several parameters using drop downs and text boxes. The users then press a button that produces an extract based on the parameters they...
4
by: eewwttww | last post by:
how to save with only WebBrowser: save html+picture without dialog box? what I Have is: WebBrowser.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_PROMPTUSER, 300, 300 I don't want this code. I want...
8
by: rn5a | last post by:
I have a HTML page named Index.html which is divided into 3 frames. The URL of 2 of the frames are HTML pages but the 3rd frame houses a ASP page. Now when I go to Windows Explorer, navigate to...
3
by: =?Utf-8?B?YXNkZg==?= | last post by:
Hello. I am making a web application with c# and am using this code: Response.ContentType = "application/x-excel"; Response.AddHeader("Content-Disposition", "attachment;filename=" +...
2
by: vbaDev | last post by:
Hi. I am using Access 2000 and in my code I'm exporting a table into an Excel file (creating it), then the code needs to export another query into the same file (a new worksheet). So I needed both a...
0
by: ppardi | last post by:
I'm developing an addin for Word 2007 and I need to determine whether a user saves a Word 2007 document in an older format (97-2003) after a save as is done. The scenario is that the user starts...
2
by: Artie | last post by:
Hi, I've searched the web but can't find a solution to an apparently really simple problem. My app contains an HTML string and I need to be able to invoke the Print Dialog to print the HTML...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.