Solved

EXECWB not working on UNDO/REDO!

Posted on 2003-11-24
14
911 Views
Last Modified: 2012-08-14
Hi experts,

I have used the following syntax(s) to undo/redo a document which is in a VB web browser. But it is not working. But the same command works on save/save as.
WebBrowser1.ExecWB OLECMDID_UNDO, OLECMDEXECOPT_DONTPROMPTUSER
WebBrowser1.ExecWB OLECMDID_REDO, OLECMDEXECOPT_DONTPROMPTUSER

Any idea???
0
Comment
Question by:amiteshsinha
  • 8
  • 6
14 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9811791
What for are you using undo/redo?, what are you trying to undo/redo?
0
 

Author Comment

by:amiteshsinha
ID: 9811915
For example I am opening a word document in VB web browser and while editing its contents I may want to make an undo or redo..of whatever I have edited. Hope I am clear.
0
 
LVL 16

Accepted Solution

by:
Richie_Simonetti earned 500 total points
ID: 9811962
I think you cannot do that way but maybe i am wrong.
Try the following

add a reference to microsoft Word object library to your project
in Documentcomplete event for webbrowser control:
dim wdoc as word.document

if (pdisp is webbrowser1.object then)
     set wdoc =webbrowser1.document
end if

from there, you could use standard Word procedures to do the job.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:amiteshsinha
ID: 9812219
No..that didn't work. But if I do ctrl+z and ctrl+y it is working. But not on a button click.
Anyother solution???
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9812475
"No..that didn't work"
Could you explain a little bit?
By the way, hotkeys works but that doesn't do the same as execwb commands.
0
 

Author Comment

by:amiteshsinha
ID: 9812652
dim wdoc as word.document

if (pdisp is webbrowser1.object then)
     set wdoc =webbrowser1.document
end if

The above said thing didn't work. It is not setting up the document from webbrowser.
But then I found out in microsoft.com that undo and redo command of execwb is " Not currently supported" by webbrowser control.
I have found a solution like capturing the ctrl z and ctrl y keys on button clicks.

Thanks for your responses.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9812688
i don't understand why you said it didn't work. I used it with no problems.
0
 

Author Comment

by:amiteshsinha
ID: 9812769
It throws the following error

run-time error '13':
type mismatch

in the line

set wdoc =webbrowser1.document
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9812843
Sorry, i didn't get that error.
Where you put the code that i gave you?
0
 

Author Comment

by:amiteshsinha
ID: 9812853
in Documentcomplete event
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9812930
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9812943
Please, replace the path at navigate method from the example at form_load to a valid one.
0
 

Author Comment

by:amiteshsinha
ID: 9812987
thanks a lot Richie, this works. But then this is not the answer for my initial question and also I have found a solution for it, hence closing this.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 9813136
Maybe not the answer that you want but my comment at 11/24/2003 09:13AM PST is correct.
Cheers
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

785 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