Solved

EXECWB not working on UNDO/REDO!

Posted on 2003-11-24
14
915 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

839 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