From: andreas on
Dear Experts:

Below macro unlinks the current headers from the previous section. How
has this code to be expanded if I also wanted the following section's
headers to be unlinked from the previous section?

Help is much appreciated. Thank you very much in advance. Regards,
Andreas

With Selection.Sections(1)
..Headers(wdHeaderFooterPrimary).LinkToPrevious = False
..Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
..Headers(wdHeaderFooterEvenPages).LinkToPrevious = False
End With

From: Stefan Blom on
You can use

With ActiveDocument.Sections(Selection.Sections(1).Index + 1)

as the first line of your code; it returns the section following the one
containing the insertion point (assuming such a section exits, which the
code doesn't test for).

An easier approach is to use a loop to access all sections:

Dim s As Section
For Each s In ActiveDocument.Sections
s.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
s.Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
s.Headers(wdHeaderFooterEvenPages).LinkToPrevious = False
Next s

--
Stefan Blom
Microsoft Word MVP



"andreas" <andreas.hermle(a)gmx.de> wrote in message
news:185a73ad-7880-4e83-bb3f-3a1c381f6add(a)d10g2000yqh.googlegroups.com...
> Dear Experts:
>
> Below macro unlinks the current headers from the previous section. How
> has this code to be expanded if I also wanted the following section's
> headers to be unlinked from the previous section?
>
> Help is much appreciated. Thank you very much in advance. Regards,
> Andreas
>
> With Selection.Sections(1)
> .Headers(wdHeaderFooterPrimary).LinkToPrevious = False
> .Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
> .Headers(wdHeaderFooterEvenPages).LinkToPrevious = False
> End With
>


From: andreas on
On Dec 12, 8:08 pm, "Stefan Blom"
<StefanB...(a)discussions.microsoft.com> wrote:
> You can use
>
> With ActiveDocument.Sections(Selection.Sections(1).Index + 1)
>
> as the first line of your code; it returns the section following the one
> containing the insertion point (assuming such a section exits, which the
> code doesn't test for).
>
> An easier approach is to use a loop to access all sections:
>
> Dim s As Section
> For Each s In ActiveDocument.Sections
> s.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
> s.Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
> s.Headers(wdHeaderFooterEvenPages).LinkToPrevious = False
> Next s
>
> --
> Stefan Blom
> Microsoft Word MVP
>
> "andreas" <andreas.her...(a)gmx.de> wrote in message
>
> news:185a73ad-7880-4e83-bb3f-3a1c381f6add(a)d10g2000yqh.googlegroups.com...
>
>
>
> > Dear Experts:
>
> > Below macro unlinks the current headers from the previous section. How
> > has this code to be expanded if I also wanted the following section's
> > headers to be unlinked from the previous section?
>
> > Help is much appreciated. Thank you very much in advance. Regards,
> > Andreas
>
> > With Selection.Sections(1)
> > .Headers(wdHeaderFooterPrimary).LinkToPrevious = False
> > .Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
> > .Headers(wdHeaderFooterEvenPages).LinkToPrevious = False
> > End With- Hide quoted text -
>
> - Show quoted text -

Hi Stefan,

thank you very much for your professional help. It works as desired.
Thank you. Regards, Andreas
From: Stefan Blom on
You are welcome.

--
Stefan Blom
Microsoft Word MVP



"andreas" <andreas.hermle(a)gmx.de> wrote in message
news:865eb06e-03db-46bf-b017-d1ae74191046(a)v25g2000yqk.googlegroups.com...
On Dec 12, 8:08 pm, "Stefan Blom"
<StefanB...(a)discussions.microsoft.com> wrote:
> You can use
>
> With ActiveDocument.Sections(Selection.Sections(1).Index + 1)
>
> as the first line of your code; it returns the section following the one
> containing the insertion point (assuming such a section exits, which the
> code doesn't test for).
>
> An easier approach is to use a loop to access all sections:
>
> Dim s As Section
> For Each s In ActiveDocument.Sections
> s.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
> s.Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
> s.Headers(wdHeaderFooterEvenPages).LinkToPrevious = False
> Next s
>
> --
> Stefan Blom
> Microsoft Word MVP
>
> "andreas" <andreas.her...(a)gmx.de> wrote in message
>
> news:185a73ad-7880-4e83-bb3f-3a1c381f6add(a)d10g2000yqh.googlegroups.com...
>
>
>
> > Dear Experts:
>
> > Below macro unlinks the current headers from the previous section. How
> > has this code to be expanded if I also wanted the following section's
> > headers to be unlinked from the previous section?
>
> > Help is much appreciated. Thank you very much in advance. Regards,
> > Andreas
>
> > With Selection.Sections(1)
> > .Headers(wdHeaderFooterPrimary).LinkToPrevious = False
> > .Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
> > .Headers(wdHeaderFooterEvenPages).LinkToPrevious = False
> > End With- Hide quoted text -
>
> - Show quoted text -

Hi Stefan,

thank you very much for your professional help. It works as desired.
Thank you. Regards, Andreas