Content Control - tracking Tag - undo/redo

D

David Thielen

Hi;

On the Content Controls the Tag can only hold 64 characters (a pox on
the moron who put that limit in!!!). So we set the tag to a guid and
have a hashmap of guids -> our text that we write to the Variables
member of the document.

It all works great except... When a user changes the text we have
attached and then does undo. The undo does not go back to our old text
because we overwrote it with the new text. And the big problem is, we
don't know on an undo when it it undoing what change in our text
attached.

Any ideas how to handle this?

thanks - dave

david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
C

Colbert Zhou [MSFT]

Hello Dave,

As far as I know, Word uses it own Undo stack to record the actions
performed. That stack cannot be accessed by other customization solutions,
which is designed to make sure Word application undo/redo function run
correctly. So there is no way to detect the Undo action. And undo action
only recovers the modifications to Word document itself. It would not
recover any user solution data or status.

If we want to support our text's undo action. We may build our logic and
implement a standalone interface for it, which can be a undo button in your
addin tab. Then when the end user click Word's undo button, the document
content are recovered. When the end user click our undo button from our
addin tab, we recover the ContentControl attached text for the user.

Best regards,
Ji Zhou - MSFT
Microsoft Online Community Support
 
D

David Thielen

Hi;

I found a work around - every time the control is changed we generate
a new guid to put in Tag with the new string. We then save the old for
when an undo takes us back to the previous Tag value.

thanks - dave


Hello Dave,

As far as I know, Word uses it own Undo stack to record the actions
performed. That stack cannot be accessed by other customization solutions,
which is designed to make sure Word application undo/redo function run
correctly. So there is no way to detect the Undo action. And undo action
only recovers the modifications to Word document itself. It would not
recover any user solution data or status.

If we want to support our text's undo action. We may build our logic and
implement a standalone interface for it, which can be a undo button in your
addin tab. Then when the end user click Word's undo button, the document
content are recovered. When the end user click our undo button from our
addin tab, we recover the ContentControl attached text for the user.

Best regards,
Ji Zhou - MSFT
Microsoft Online Community Support


david@[email protected]
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top