Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I check for new page in MS Word?

Status
Not open for further replies.

buggseywork

Programmer
Jan 22, 2004
9
CA
Hi;

I have a section of text in a table that has form fields in it (it cannot go into the header) and I want it to automatically be copied to the top of a new page (Page 2 etc) when the user types enough to actually cause a new page to happen. I know how to copy the section in question but I do not know how to detect that a new page has been created. Is it possible to detect a new page has been forced in Word and how.

Thank You;
Bugs
 
Hi buggseywork,

What is the reason that you can't you have the row as a Table Heading? I don't think there's any restriction on having Form fields in a heading row.

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Hi TonyJollans... thanks for your reply.
Sorry, Miscommunication on my part. What I meant is I cannot put the form fields in the Document Header. If I could, every time a new page was forced, the data would show up in the header. Unfortunately this is not the case :-( . I have searched high and low to try and find a method to determine when a new page has been forced in Word... I have found nothing I can use... I still require a solution... any help would be appreciated... I don't mind a suggestion that would check the page number or some such thing... If it works...I am good with it at this point. :) Finding an event that will be triggered when the new page is created is the problem I think I am facing.

Any help would be greatly appreciated...
thanks
Bugs
 
Hi Bugs,

So why not a Table Heading Row?

Then Word does it all so you don't need to bother.

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Hi Tony;

That is a great idea and would be a viable solution as well but... unfortunately the table only consists of a couple of rows. It is in it's own section at the top of the document and I have it protected from changes.
When the document opens the cursor actually appears below this section/table and the user can type freely. Hence the issue, the user types the body of the document and spans more than one page. The header information is placed on the second page by Word but the section with the table and form fields in it is not. I want to programatically copy this section (table) to the second and subsequent pages as soon as that new page is created. I hope this clears up any of the confusion I have created...

Best Regards;
Bugs
 
Hi Bugs,

I don't think there's any way you can dynamically pick up when a new page is created. Also, to make it work properly you'd need to pick up when one was deleted as well, which would be even harder as it wouldn't actually be deleted by Word because it had your table on it. I also suspect that making copies of your table would play havoc with text flow (it certainly would if it was in a separate section).

All in all, I would try and find another solution. Is there really no way you can get what you want in the Page Header? I don't really understand what's stopping you (of course that's probably my ignorance rather than anything else).

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Hi Tony;

I have to thank you for taking the time to look at this... You are absolutely right... it would be a pain in the butt to get this to work by monitoring events and what not. I will give a macro button on a toolbar that will go through the finished document and place this table as the first section on every page...

I think "ignorance" is a very strong word... Ha Ha :) everything is easy once you are filled in... :)

For the record... this data in the table is protected for a very good reason and I have to keep within the confines of the following scenario which makes it even more difficult to code around...

I am writting a system where the typist can press a button on the toolbar and archive the document they are working on to a clients file. (It creates a graphic file (MOD:CA - proprietary IBM Graphic format) and sends it to the AS/400 to be attached to the clients file.)

The form fields are actually filled and validated via a connection to an AS/400 and contain Key data used for archiving/imaging (Client # for instance). The data is read from the form later by the imaging macro after the dictated text is typed in. So, it is very important that this key data remain on the form unchanged(First Page anyhow) because if it were to be inadvertantly changed it would possibly cause the document to be imaged agaist the wrong client file... Not pretty...

I didn't want to bore you with the gory details but that is what I was facing... thanks to your help I have confirmed that this whole line of thought is not the way to go. The other options are not quite as elegant as detecting a new page and all that but I know it will work so....

onward and upward I say!

Thanks again for your help...

Take Care;
Bugs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top