Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / October 2006

Tip: Looking for answers? Try searching our database.

Catching changes in pageheader/pagefoot

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Karlström - 18 Oct 2006 07:13 GMT
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
Signature

Peter Karlström
Midrange AB
Sweden

Jonathan West - 18 Oct 2006 10:10 GMT
> Hi
>
[quoted text clipped - 10 lines]
> 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.

Signature

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

Peter Karlström - 18 Oct 2006 10:56 GMT
Perfect Jonathan

This will work like a charm!

Thanks a million!

Regards
Signature

Peter Karlström
Midrange AB
Sweden

> > Hi
> >
[quoted text clipped - 29 lines]
> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.