Solved

Office Undo... Export to Array?

Posted on 2014-03-04
3
406 Views
Last Modified: 2014-03-05
Hi All

I am wondering if it is possible to export the undo history from MS Word / MS Excel and if there is simple (fast) code to achieve this.

I would be happy to fill an array / scripting dictionary / table with the descriptions of the available Undo Actions.

Any thoughts on how to achieve?

Kind regards,
0
Comment
Question by:DrTribos
  • 2
3 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 500 total points
Comment Utility
The undo buffer is not available to us via the application object model so, no, you can't export it or access it in any way.

This has been a bone of contention with Microsoft for years as it makes controlling the undo buffer impossible. Did you know that the entire buffer is cleared when certain properties are set or methods invoked from VBA?

Kevin
0
 
LVL 14

Author Comment

by:DrTribos
Comment Utility
Thank you for your comments, explains why I keep hitting a brick wall!

No I did not know that, can you provide a few examples?
0
 
LVL 81

Expert Comment

by:zorvek (Kevin Jones)
Comment Utility
Basically setting any worksheet property or invoking a method that changes a worksheet will reset (clear) the undo buffer. An example is accessing the UsedRange object. Any time the Worksheet.UsedRange property is accessed, the undo buffer is cleared.

This makes sense if you think about it. The undo buffer contains specific instructions to undo user actions. If VBA code executes and starts monkeying with the worksheet, that runs the risk of rendering the undo buffer's instructions obsolete. Rather than write mountains of logic to handle all possible cases - or record every VBA invoked worksheet change in the buffer, Microsoft chose to just clear the buffer when ANY worksheet property is changed from VBA. Easy solution to a very difficult problem.

Kevin
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This is written from a 'VBA for MS Word' perspective, but I am sure it applies to most other MS Office components where VBA is used.  One thing that really bugs me is slow code, ESPECIALLY when it's mine!  In programming there are so many ways to…
Outlook Free & Paid Tools
Office 365 is currently available in five editions. Three of them are for business use: Office 365 Business Essentials, Office 365 Business, and Office 365 Business Premium. Two of them are for home/personal use: Office 365 Home and Office 365 Perso…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now