kurt was telling us:
kurt nous racontait que :
> I'm writing a macro that uses the following code, but at this point I
> get an error, and my macro does not allow going into the header.
[quoted text clipped - 18 lines]
>
> ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
Looks like you are using the macro recorder...
This is fine to get an idea, but you should refine it by hand, see
for more on this.
http://word.mvps.org/FAQs/MacrosVBA/ModifyRecordedMacro.htm
Meanwhile, your macro could be simplified like this:
'_______________________________________
With Selection.Sections(1).Headers(wdHeaderFooterPrimary) _
.Range.Paragraphs(3).Range
.PasteAndFormat wdPasteDefault
End With
'_______________________________________
No Selection object and no need to "physically" go into the header.
You have to make sure the current header has at least three paragraphs and
you may want to change "wdHeaderFooterPrimary" to match your type of header.

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
kurt - 02 Aug 2005 09:23 GMT
Bonjour Jean-Guy,
Merci pour votre aide!
Can you suggest a book or two for learning VBA in Word?
Merci mille fois.
Kurt

Signature
kurt
> kurt was telling us:
> kurt nous racontait que :
[quoted text clipped - 43 lines]
> You have to make sure the current header has at least three paragraphs and
> you may want to change "wdHeaderFooterPrimary" to match your type of header.
Jean-Guy Marcil - 02 Aug 2005 12:43 GMT
kurt was telling us:
kurt nous racontait que :
> Bonjour Jean-Guy,
>
> Merci pour votre aide!
>
> Can you suggest a book or two for learning VBA in Word?
I am not sure about particular books about VBA... but you can start by the
VBA section of the MVP site...
http://word.mvps.org/faqs/MacrosVBA/index.htm

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