[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 972
  • Last Modified:

EXECWB not working on UNDO/REDO!

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
amiteshsinha
Asked:
amiteshsinha
  • 8
  • 6
1 Solution
 
Richie_SimonettiIT OperationsCommented:
What for are you using undo/redo?, what are you trying to undo/redo?
0
 
amiteshsinhaAuthor Commented:
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
 
Richie_SimonettiIT OperationsCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
amiteshsinhaAuthor Commented:
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
 
Richie_SimonettiIT OperationsCommented:
"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
 
amiteshsinhaAuthor Commented:
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
 
Richie_SimonettiIT OperationsCommented:
i don't understand why you said it didn't work. I used it with no problems.
0
 
amiteshsinhaAuthor Commented:
It throws the following error

run-time error '13':
type mismatch

in the line

set wdoc =webbrowser1.document
0
 
Richie_SimonettiIT OperationsCommented:
Sorry, i didn't get that error.
Where you put the code that i gave you?
0
 
amiteshsinhaAuthor Commented:
in Documentcomplete event
0
 
Richie_SimonettiIT OperationsCommented:
0
 
Richie_SimonettiIT OperationsCommented:
Please, replace the path at navigate method from the example at form_load to a valid one.
0
 
amiteshsinhaAuthor Commented:
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
 
Richie_SimonettiIT OperationsCommented:
Maybe not the answer that you want but my comment at 11/24/2003 09:13AM PST is correct.
Cheers
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 8
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now