View Single Post
  #4   Report Post  
Posted to microsoft.public.word.pagelayout
Charles Kenyon
 
Posts: n/a
Default Headers and Footers in Main Body with Table Breaks

What you are trying to do is very difficult. It runs counter to the way Word
is designed to work.

Headers and footers are intended to be multi-page creations, often
reflecting information that shows up in pages using the StyleRef field.

Word doesn't really understand or use pages, as such. They are print-time
constructs.

If you can tell us why you are doing this, I suspect someone can tell you
how to accomplish what you want using Word's features rather than fighting
them.

By the way, you'll probably want to try posting in the vba.beginners
newsgroup instead, since it is a vba question.

Final comment, learn how Word works before you try to program it. Otherwise
you will either spend a lot of time writing code to do something that Word
already does very well or you'll end up fighting with Word, having it seem
to undo what you are attempting. While this learning process may take a bit
of time, within in relatively short time, you'll be saving hours, days, or
even weeks of effort.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://word.mvps.org/FAQs/ which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.


"NewUser_Sanket" wrote in message
...
Hello All,

I am a new to VBA or programming, but felt this was the right group to
post
my question on. I want to do this one task in MS Word and felt that VBA
would
the best to go along with it. Correct me if I am wrong in any of the above
statements. I am using Word 2003.

Task: I have a multipage document in .rtf format. This document has
table
in it which occupies more than a page. All pages will have header and
footer.
I want to remove this header and footer and put the text in them in the
main
document one every page- at the top of each page for the header and bottom
of
each page for footer. If there is a table spanning more than a page, then
I
need to break the table at the appropriate point (which should depend upon
the size of the header and the footer) and continue the table on the next
page after the header on page -2.

Trying to put things in a simpler way: Lets say I have a document with 3
pages. The document has header and footer on every page. The content of
the
document is a long table spanning all 3 pages.
Eg: Header(page1) Page1 Table Footer
Header(page2) Page2 Table Footer
Header(page3) Page3 Table Footer.

I want to convert this to :
No Header Text(from header) - Table - Text(from footer) No Footer in
Page1
No Header Text(from header) - Table - Text(from footer) No Footer in
Page2
No Header Text(from header) - Table - Text(from footer) No Footer in
Page3
and the same in page 4 if the table happens to go to it.

I recorded some related macros and looked at the VB code generated, but it
was way outside my box to understand what was going on.
Any help would be appreciated.

Best Regards,
Sanket