To shut off my link to previous for the current page and then the next page,
I did the following but it only shuts off the headers, not the footers. I
get the same code when I follow my keystrokes. Why is this nor working?

ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.LinkToPrevious = Not _
Selection.HeaderFooter.LinkToPrevious
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
Selection.HeaderFooter.LinkToPrevious = Not _
Selection.HeaderFooter.LinkToPrevious
ActiveWindow.ActivePane.View.NextHeaderFooter
Selection.HeaderFooter.LinkToPrevious = Not _
Selection.HeaderFooter.LinkToPrevious
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.LinkToPrevious = Not
Selection.HeaderFooter.LinkToPrevious
ActiveWindow.ActivePane.View.PreviousHeaderFooter
--
Debra Ann

RE: Selection.HeaderFooter.LinkToPrevious by DebraAnn

DebraAnn
Thu Oct 27 08:29:05 CDT 2005

Okay, I found some help from Doug Robbins on a previous thread that used:

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

I could use this, but how do I tell it to do the current section and the
following section? Can you do With Selection.Sections(Current)?

--
Debra Ann


"Debra Ann" wrote:

> To shut off my link to previous for the current page and then the next page,
> I did the following but it only shuts off the headers, not the footers. I
> get the same code when I follow my keystrokes. Why is this nor working?
>
> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
> Selection.HeaderFooter.LinkToPrevious = Not _
> Selection.HeaderFooter.LinkToPrevious
> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
> Selection.HeaderFooter.LinkToPrevious = Not _
> Selection.HeaderFooter.LinkToPrevious
> ActiveWindow.ActivePane.View.NextHeaderFooter
> Selection.HeaderFooter.LinkToPrevious = Not _
> Selection.HeaderFooter.LinkToPrevious
> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
> Selection.HeaderFooter.LinkToPrevious = Not
> Selection.HeaderFooter.LinkToPrevious
> ActiveWindow.ActivePane.View.PreviousHeaderFooter
> --
> Debra Ann

Re: Selection.HeaderFooter.LinkToPrevious by Jean-Guy

Jean-Guy
Thu Oct 27 09:00:27 CDT 2005

Debra Ann was telling us:
Debra Ann nous racontait que :

> Okay, I found some help from Doug Robbins on a previous thread that
> used:
>
> With Selection.Sections(1)
> .Headers(wdHeaderFooterPrimary).LinkToPrevious = False
> .Footers(wdHeaderFooterPrimary).LinkToPrevious = False
> End With
>
> I could use this, but how do I tell it to do the current section and
> the following section? Can you do With Selection.Sections(Current)?
>
>
>> To shut off my link to previous for the current page and then the
>> next page, I did the following but it only shuts off the headers,
>> not the footers. I get the same code when I follow my keystrokes.
>> Why is this nor working?
>>
>> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
>> Selection.HeaderFooter.LinkToPrevious = Not _
>> Selection.HeaderFooter.LinkToPrevious
>> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
>> Selection.HeaderFooter.LinkToPrevious = Not _
>> Selection.HeaderFooter.LinkToPrevious
>> ActiveWindow.ActivePane.View.NextHeaderFooter
>> Selection.HeaderFooter.LinkToPrevious = Not _
>> Selection.HeaderFooter.LinkToPrevious
>> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
>> Selection.HeaderFooter.LinkToPrevious = Not
>> Selection.HeaderFooter.LinkToPrevious
>> ActiveWindow.ActivePane.View.PreviousHeaderFooter
>> --
>> Debra Ann

Something like this (which also checks to make sure there is a section after
the currently active one):

'_______________________________________
Dim CurSecIndex As Long

CurSecIndex = Selection.Sections(1).Index

With ActiveDocument.Sections(CurSecIndex)
.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
End With

If CurSecIndex + 1 <= ActiveDocument.Sections.Count Then
With ActiveDocument.Sections(CurSecIndex + 1)
.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
.Footers(wdHeaderFooterPrimary).LinkToPrevious = False
End With
End If
'_______________________________________

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org



Re: Selection.HeaderFooter.LinkToPrevious by DebraAnn

DebraAnn
Thu Oct 27 11:50:51 CDT 2005

This worked awesome and solved two of my problems at the same time. I can't
thank you enough.

Thank you, thank you, thank you.

--
Debra Ann


"Jean-Guy Marcil" wrote:

> Debra Ann was telling us:
> Debra Ann nous racontait que :
>
> > Okay, I found some help from Doug Robbins on a previous thread that
> > used:
> >
> > With Selection.Sections(1)
> > .Headers(wdHeaderFooterPrimary).LinkToPrevious = False
> > .Footers(wdHeaderFooterPrimary).LinkToPrevious = False
> > End With
> >
> > I could use this, but how do I tell it to do the current section and
> > the following section? Can you do With Selection.Sections(Current)?
> >
> >
> >> To shut off my link to previous for the current page and then the
> >> next page, I did the following but it only shuts off the headers,
> >> not the footers. I get the same code when I follow my keystrokes.
> >> Why is this nor working?
> >>
> >> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
> >> Selection.HeaderFooter.LinkToPrevious = Not _
> >> Selection.HeaderFooter.LinkToPrevious
> >> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
> >> Selection.HeaderFooter.LinkToPrevious = Not _
> >> Selection.HeaderFooter.LinkToPrevious
> >> ActiveWindow.ActivePane.View.NextHeaderFooter
> >> Selection.HeaderFooter.LinkToPrevious = Not _
> >> Selection.HeaderFooter.LinkToPrevious
> >> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
> >> Selection.HeaderFooter.LinkToPrevious = Not
> >> Selection.HeaderFooter.LinkToPrevious
> >> ActiveWindow.ActivePane.View.PreviousHeaderFooter
> >> --
> >> Debra Ann
>
> Something like this (which also checks to make sure there is a section after
> the currently active one):
>
> '_______________________________________
> Dim CurSecIndex As Long
>
> CurSecIndex = Selection.Sections(1).Index
>
> With ActiveDocument.Sections(CurSecIndex)
> .Headers(wdHeaderFooterPrimary).LinkToPrevious = False
> .Footers(wdHeaderFooterPrimary).LinkToPrevious = False
> End With
>
> If CurSecIndex + 1 <= ActiveDocument.Sections.Count Then
> With ActiveDocument.Sections(CurSecIndex + 1)
> .Headers(wdHeaderFooterPrimary).LinkToPrevious = False
> .Footers(wdHeaderFooterPrimary).LinkToPrevious = False
> End With
> End If
> '_______________________________________
>
> --
> Salut!
> _______________________________________
> Jean-Guy Marcil - Word MVP
> jmarcilREMOVE@CAPSsympatico.caTHISTOO
> Word MVP site: http://www.word.mvps.org
>
>
>

RE: Selection.HeaderFooter.LinkToPrevious by zkid

zkid
Thu Oct 27 12:39:04 CDT 2005

This code used to work well in Word97. However, the subsequent versions have
made life a bit more difficult. This is a subroutine I use when I need to
insert a new section and I'm using different first page. If you aren't using
different first page, then just use the "primary" code You pass the current
section number when you call it:

Sub NewSection(j as integer)

With ActiveDocument
.Sections(j).Headers(wdHeaderFooterPrimary).LinkToPrevious = False
.Sections(j).Footers(wdHeaderFooterPrimary).LinkToPrevious = False

.Sections(j).Footers(wdHeaderFooterPrimary).PageNumbers.RestartNumberingAtSection = True

.Sections(j).Footers(wdHeaderFooterPrimary).PageNumbers.StartingNumber = 1
.Sections(j).Headers(wdHeaderFooterFirstPage).LinkToPrevious = False
.Sections(j).Footers(wdHeaderFooterFirstPage).LinkToPrevious = False
End with


Greetings from California - zkid.

"Debra Ann" wrote:

> To shut off my link to previous for the current page and then the next page,
> I did the following but it only shuts off the headers, not the footers. I
> get the same code when I follow my keystrokes. Why is this nor working?
>
> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
> Selection.HeaderFooter.LinkToPrevious = Not _
> Selection.HeaderFooter.LinkToPrevious
> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
> Selection.HeaderFooter.LinkToPrevious = Not _
> Selection.HeaderFooter.LinkToPrevious
> ActiveWindow.ActivePane.View.NextHeaderFooter
> Selection.HeaderFooter.LinkToPrevious = Not _
> Selection.HeaderFooter.LinkToPrevious
> ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
> Selection.HeaderFooter.LinkToPrevious = Not
> Selection.HeaderFooter.LinkToPrevious
> ActiveWindow.ActivePane.View.PreviousHeaderFooter
> --
> Debra Ann

Re: Selection.HeaderFooter.LinkToPrevious by Jean-Guy

Jean-Guy
Thu Oct 27 13:02:12 CDT 2005

Debra Ann was telling us:
Debra Ann nous racontait que :

> This worked awesome and solved two of my problems at the same time.
> I can't thank you enough.

<blush>
Sure you can...

> Thank you, thank you, thank you.

See, one "Thank you" would have been enough for me!

Glad I could help!

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org