For header and footer

  • Thread starter Thread starter sreelu.lakshmi
  • Start date Start date
S

sreelu.lakshmi

Hi i have this code,
Dim mytable As Object
Dim objWord As Object
Dim myVars As Object
Dim myDoc As Object


objWord.ActiveDocument.Sections(1).headers(wdHeaderFooterPrimary).Range.Fields.Update
objWord.ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Fields.Update
it is giving the "compile error variable not defied " in my project.

can any one give me the solution ..

Thank you
Sreelu
 
Hi i have this code,
Dim mytable As Object
Dim objWord As Object
Dim myVars As Object
Dim myDoc As Object


objWord.ActiveDocument.Sections(1).headers(wdHeaderFooterPrimary).Range.Fields.Update
objWord.ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range.Fields.Update
it is giving the "compile error variable not defied " in my project.

can any one give me the solution ..


It looks like you're using late binding, so maybe you don't have any
definition for the Word constant wdHeaderFooterPrimary. Without a reference
set to the Word object library, you'll need to define that constant
yourself:

Const wdHeaderFooterPrimary = 1
 
Back
Top