Problem mixing WindowSelectionChange & Undo in Word 2010


Joined
Mar 8, 2012
Messages
1
Reaction score
0
Hi,
I don't understand what happens when Word is undoing a group of actions. It seems that the normal model's objects commands are no more available and the 6197 error arise.

I try to be more specific.

I'm developing a Project Template for Word 2007 and 2010.
Basically I have a Table blocked by a Group Content Control. So all the editing in the table must be accomplishing by first removing the Group Content Control, doing what is the case, and then putting back the GCC.

Since I want that the Ribbon would be updated accordingly the row selected I used the WindowSelectionChange event.

The 6197 "Model's objects command not available in the present event" arise when I undo a group of actions.

I have tried to cut my project to the bones, if someone would be so kind to take a look at the problem and I have attached 4 files: Two classes: a) clsMyObject and b) clsEventApp; and two normal modules: c) modToolsAndGlobal and d) modMain.

clsMyObject , as I said, is basically a Table blocked by a Group Content Control (in the rows there are RTF CC), so every adding, erasing, etc. of rows as to be done by code first removing the GCC and then put it back.

clsEventApp is used to take trace of the cursor so I can update the ribbon

modToolsAndGlobal holds the global variables and some istrumental routines

modMain has two sub: one to set the appliction to respond to the ChangedSelection event and the other to try to do something with MyObject

If someone would like to give a try should:

1) run the Sub PrepareMyObjectInDoc to have the blocked table on which to work.
2) run the Sub SetEventApplication to follow the movement of the selection
3) run the Sub Try

Thanks, Lauro
 
Ad

Advertisements


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