[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

EXECWB not working on UNDO/REDO!

Posted on 2003-11-24
14
Medium Priority
?
966 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 1500 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

834 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