bryan said:
If only I were a guru!
I am using the templates provided with the header/footer. I do not have the
options to work with the footer/header.
I've tried umpteen different ways with my form.
I think I've narrowed it down a bit to where the problem is that I am hiding
the check box and another form field towards the bottom of the main form. If
I leave those unhidden it works fine. An undesireable solution. I do not have
any paragraph marks after "Remove Form". If I add any paragraph marks, then
when I delete the 2nd page, I loose the header/footer even if I have the last
2 form fieldss not hidden.
If you are hiding stuff (Using the "Hidden" attribute on the Font dialog),
make sure you are working in "Show All" mode (Click on the ¶ button to
display all non printing characters). Then, when you apply the hidden
attribute, make sure you do not select the Section break itself. This might
be a bit tricky becasue Word does not highlight in black a selected Section
Break like it does with Page Breaks and other characters... Yet another
bizarre design flaw...
For instance, let's say you have:
....some text.¶
=======(Section Next Page)======
New page paragraph...¶
Position your cursor just before the "t" in "text.¶" above and do the
following:
Hold down the SHIFT key, then hit the Right arrow on the keyboard. The "t"
gets selected. Hit the Right arrow 4 more time to select "text."
Now hit the Right arrow one more time. The ¶ gets selected and you can see
that.
Hit the right arrow yet one more time. Nothing seems to happen on the
screen. In fact, the section break is now selected. To confirm that, hit the
Right arrow again (Still while holding the SHIFT key down) and you will see
that the "N" at the top of the next page gets selected.
If you triple-click a paragraph immediately preceding a section break, the
whole paragraph gets selected, but the section break does not. However, let's
you have a one-line paragraph immediatley before a section break, and instead
of triple-clicking to select the paragrpah, you single-click in the left
margin to select the one-line paragraph, now the section break is selected...
See...? You have to be careful when assigning attributes to text around
section breaks because although they do not print, section breaks are like
characters and will take on any font/paragraph attributes you care to assign
to them.
This migth have to do with the fact that your print preview is different
from your display in regular view.
I would be open to doing a webex session to have you look at what I am doing
and what I am missing.
Sorry, no can do... At work they will certainly not allow a Webex session...
And I do not have time to do NG stuff at home... I have two teen age sons who
are into sports and music... so I do not have lots of free time!
I am fairly new to working this indepth with Word and unfortunately have no
giudance other than what I am gathering from the DG, which is great!
When writing code that handle section breaks, work with ranges as you seem
to be doing.
Then, debug the code step by step (Use F8 in the VBA editor window). But
before you debug, split your screen in two so you have the Word document
window above the VBA editor window. Each time you hit F8 in the VBA editor
window, see what happens to your document (If anything, depending on the
actual line that gets executed... A "Set.." line will not have any impact on
the document, obviously...). Also, for debugging purposes, every time you
change your Range object, insert a "Range.Select" line after modifying the
Range object to see if the new range is what it should be. Once you have the
code do what you want it do, you can remove those "Range.Select" lines.
This way, if you notice that your range is not what you expect it to be, you
know you have to modify the code accordinbgly. Finally, carefully read the
post where I explain what happens to headers/footers in the penultimate
section of a document when you delete the last section of that document.
I know it is frustrating, but I believe we have all gone through this phase
where we learn to control a Range object in our code while learning to
understand the impact of removing section breaks and/or the last "¶" in the
document. It is well worth it to invest some time now, but once you
understand what is going on, you will be able to write very "surgically"
precise code that will handle adding, deleting, modifying sections...