tags:

views:

428

answers:

3

I need to reinforce the structure of a Microsoft Word document.
EG:

Style Question here blah blah blah
Style Answer Here blah blahblah

The enforcement here would be the "Answer" style cannot be placed unless there is a "Question" style above it.

To do this I would use a Macro, so ideally I would like to call my Macro everytime the document is edited.

I have read through the Microsoft Office Word 2003 Visual Basic Reference but have not found any events that have this effect.

Does anyone know how to do this. Or anyone have any other ideas?

+1  A: 

This thread http://stackoverflow.com/questions/269252/vba-event-for-document-edited relates to events for Word documents, including the Change event. Perhaps it will help.

Remou
Yes I am aware of that thread because I am the one who started it.
joe
A: 

Or anyone have any other ideas?

You can have a button that open a custom dialog where the user can enter the question and answer and then press enter and then the dialog automatically format the question/answer correctly. Just one way to go..

Stefan
Good thought. But I believe because of our use case that would be too much overhead for the user.
joe
Along those lines though, I could have a Macro powerd button that the user presses to insert a new style as apposed to using the styles menu.
joe
A: 

I am wondering if WindowSelectionChange might work.

joe