Catching changes in pageheader/pagefoot

P

Peter Karlström

Hi

I'm developing a COM-Addin which creates documents based on rules and
designs in a database.
The pagesheader and pagesfooter are built up depending on the type of document
the user has chosen to create.

Now, I want to perform some checkups if the user manually changes the
contents of the pageheader or pagefooter.

Is this possible and if so, how?
The COM-Addin is developed in Visual Basic 6.0 and is supposed to work in
Word 2002 (XP) and Word 2003.

Thanks in advance
 
J

Jonathan West

Peter Karlström said:
Hi

I'm developing a COM-Addin which creates documents based on rules and
designs in a database.
The pagesheader and pagesfooter are built up depending on the type of
document
the user has chosen to create.

Now, I want to perform some checkups if the user manually changes the
contents of the pageheader or pagefooter.

Is this possible and if so, how?
The COM-Addin is developed in Visual Basic 6.0 and is supposed to work in
Word 2002 (XP) and Word 2003.

You can include some code in the WindowSelectionChange event. The Sel
parameter that is passed to the event code gives you the current selection.
You can work out whether the selection is in a header or footer by checking
the StoryType property.

This article gives you an example of the kind of thing you can do with this
event.

How can I prevent users from editing the header of a document in Word 2000
or higher?
http://www.word.mvps.org/FAQs/Customization/ProtectWord2000PlusHeader.htm

That will at least tell you whether the user might have edited the headers &
footers - if the user never goes there, he obviously didn't edit anything
there, at least while your add-in was connected.

However, if this is not good enough for you, you may just have to do a
comparison between what the headers contain and what they should contain.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org
 

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