Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Office Undo... Export to Array?

Posted on 2014-03-04
3
Medium Priority
?
425 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 81

Accepted Solution

by:
zorvek (Kevin Jones) earned 2000 total points
ID: 39905586
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 15

Author Comment

by:DrTribos
ID: 39905607
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)
ID: 39905652
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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

704 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