Discussion:
Pagebrakes and pageheadings/footings
(too old to reply)
Peter Karlström
2006-09-19 13:31:01 UTC
Permalink
Hi

I'm developing a COM-Addin for Word as a part of a integration to a system
for document management.

It is a rich and database-dependent Addin which creates and maintains
documents using specialized toolbar functions.

We have a problem:
One of the objects is to fully create pageheaders/footings for the first
page and a different ones for the following pages.
When a new document is created we check if the document consists of 1 or
more pages. If there is only one page, a pagebreak is inserted in order to
create the correct pageheader (and foot) for page 2 and forward.

The problem is that when we create a new "template" the document refuses to
accept different pageheadings/footings than the first one. There seem to be
some sort of property in our original template that works OK, but in new
templates it just doesn't work.
An "easy" but unproffessional approach would be to tell the customer to use
the OK template and copy it for creating new ones, but this is not the
solution we want to deliver.

Does anybody know what this setting is and how to change it?

Thanks in advance

Regards
Peter Karlström
Midrange AB, Sweden
--
Peter Karlström
Midrange AB
Sweden
Cindy M.
2006-09-19 13:54:27 UTC
Permalink
Hi =?Utf-8?B?UGV0ZXIgS2FybHN0csO2bQ==?=,
Post by Peter Karlström
One of the objects is to fully create pageheaders/footings for the first
page and a different ones for the following pages.
When a new document is created we check if the document consists of 1 or
more pages. If there is only one page, a pagebreak is inserted in order to
create the correct pageheader (and foot) for page 2 and forward.
This shouldn't be necessary. The headers/footers exist logically in the
document, even if they can't be seen. Just manipulate the appropriate range

Dim rngHeaderFirstPage as Word.Range
Dim rngHeaderOtherPages as Word.Range

Set rngHeaderFirstPage =
ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Range

Set rngHeaderOtherPages =
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Peter Karlström
2006-09-19 14:05:01 UTC
Permalink
Hi Cindy

Thanks for your quick reply.

I'll look into that.

Regards
--
Peter Karlström
Midrange AB
Sweden
Post by Cindy M.
Hi =?Utf-8?B?UGV0ZXIgS2FybHN0csO2bQ==?=,
Post by Peter Karlström
One of the objects is to fully create pageheaders/footings for the first
page and a different ones for the following pages.
When a new document is created we check if the document consists of 1 or
more pages. If there is only one page, a pagebreak is inserted in order to
create the correct pageheader (and foot) for page 2 and forward.
This shouldn't be necessary. The headers/footers exist logically in the
document, even if they can't be seen. Just manipulate the appropriate range
Dim rngHeaderFirstPage as Word.Range
Dim rngHeaderOtherPages as Word.Range
Set rngHeaderFirstPage =
ActiveDocument.Sections(1).Headers(wdHeaderFooterFirstPage).Range
Set rngHeaderOtherPages =
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)
Loading...