Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27214

Editing page header/footer

$
0
0
We have a lot (thousands) of documents that need re-formatting. It includes (but not limited to) amendment to headers and footers.

In the scenario I'm currently dealing with as a test document - I have a 1 page document. The document has a first page header, and a page header setup.

Because it is only 1 page, I cannot reformat the page header - only the first page header. This is a problem because if a user decides after it's been formatted that they now want the document to go across 2+ pages, the out of date formatting still exists in the page header.

Is there a way I can format the page header, even though it's not currently "viewable"?

The only way I can think to do it is to go to the end of the document, create a page break, edit the header/footer then go back and delete the page break. :(

i.e

ActiveWindow.View.SeekView = Word.WdSeekView.wdSeekPrimaryHeader = error if only 1 page

Possible fix
{reformat header}
If NumPages > 1 Then
ActiveWindow.ActivePane.View.NextHeaderFooter
{reformat crap}
else
{put in page break and then view nextheaderfooter / delete content / delete page break}
End If

Hope that makes sense
TIA

Viewing all articles
Browse latest Browse all 27214

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>