Is there an event from a table?

M

Miked

I want to catch the event that occurs when you add a new row to a
table. Does this exist and is there anywhere I can grab it?

Thanks so much in advance!

Mike
 
J

Jezebel

There is no direct method, but the WindowSelectionChange event is fired if
you tab into a cell (such as happens if you tab from the last cell of a
table, thus creating a new row, or if you add a row by menu then tab into
it). AT that point you can check if you are in a table, and if so if you are
in its last row and if that row is empty. Less than ideal, but can be
workable.
 
M

Miked

Jezebel:

That sounds great! and I can totally figure out if I'm in the right
place. But how would i use this programmatically...meaning, how can I
actually enter code that will be fired when this even fires?

Thanks in advance for your help!

Mike D
 
J

Jezebel

Read the Help topic on trapping word events.

In summary ---

1. Add a class module that contains a WithEvents declaration of a variable
for the Word application, eg

Private WithEvents mWordApp as Word.Application

2. Within the class module, write initialisation code to set the variable,
and write procedures for each of the events you want to trap.

3. Within your main code, instantiate an instance of your class object.
 

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