Headers (the same but different for each section)

G

Guest

Hi,

I have about 12 sections in my document. The first part of the header is the
same for each section and has a reference field in it. The second part of the
header is different for each section, as it reference the section name. Is
there a way that the header can be automated so my users don't have to update
each section using the F9 key.

The "same as previous" option will not work in this case. It works for my
footers as the only difference is my page number.

I would appreciate any help anyone can give.

Thanks, Karen
 
J

Jay Freedman

If the section name (I presume on the first page of each section) is
formatted with a unique style, then you can use a StyleRef field in the
header to repeat that text on each page. In that case, you can use Same as
Previous throughout the document.

See the "Beyond Numbering" section of
http://word.mvps.org/faqs/formatting/numberingfrontmatter.htm for details.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

Jay Freedman

If you don't already have a section break between the last chapter and the
first appendix, put one in. Then go into the header of the appendix and turn
off the Same As Previous button on the Header toolbar. Now you can put the
StyleRef for Heading 7 in the appendix header and remove the StyleRef for
Heading 1.

The article at
http://www.word.mvps.org/FAQs/Formatting/NumberingFrontMatter.htm explains
the procedure -- just read "main document" and "appendix" in place of
"frontmatter" and "main document", respectively; and "StyleRef field" in
place of "page number".

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
J

Jay Freedman

Instructions for using macros are at
http://www.gmayor.com/installing_macro.htm. The code should go into the
template for your documents (or into a global add-in), not in the documents
themselves.

It isn't clear from the earlier parts of the thread whether you actually
have a template (a .dot file), or whether you're just passing around copies
of a document. I strongly suggest you use a template
(http://www.word.mvps.org/FAQs/Customization/CreateATemplatePart1.htm). In
that case, the macro won't have any effect at all on the size of the
document. The problem with putting a macro in a document is not that it
changes the size, but that macros in documents are a security risk, so Word
makes it as difficult as possible to use them. It either disables them
completely or displays a scary warning box every time the document is
opened, depending on the setting of an obscure option in the Tools > Macro >
Security dialog.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
S

Suzanne S. Barnhill

All content in headers and footers is automatically updated when you print
or Print Preview, and StyleRef fields update automatically anyway.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

Hi, I am using Graham's macro as suggested by Jay, however, it doesn't appear
to update the Table of Contents, Tables, and Figures that I have. It works
great for the headers, footers, bookmarks, fields, etc. Does anyone know a
way to modify this macro in order for it to update everything in the
document? Thanks, Karen
 
G

Graham Mayor

The following should hit everything :)

Sub Update()
Dim oField As Field
Dim oSection As Section
Dim oHeader As HeaderFooter
Dim oFooter As HeaderFooter
Dim oTOC As TableOfContents
Dim oFig As TableOfFigures
Dim oAut As TableOfAuthorities

For Each oTOC In ActiveDocument.TablesOfContents
oTOC.Update
Next oTOC

For Each oFig In ActiveDocument.TablesOfFigures
oFig.Update
Next oFig

For Each oAut In ActiveDocument.TablesOfAuthorities
oAut.Update
Next oAut

For Each oSection In ActiveDocument.Sections
For Each oHeader In oSection.Headers
If oHeader.Exists Then
For Each oField In oHeader.Range.Fields
oField.Update
Next oField
End If
Next oHeader
For Each oFooter In oSection.Footers
If oFooter.Exists Then
For Each oField In oFooter.Range.Fields
oField.Update
Next oField
End If
Next oFooter
Next oSection
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top