Word Headers/Footers in C#

  • Thread starter Thread starter Cemil Örüm
  • Start date Start date
C

Cemil Örüm

Hello,

can anybody tell me, how I can change the header and the footer of a
word-document with c# ?
I already know, how to open word and how to create a document and paste text
into it, but I cannot access the header/footer.

Thanks for your help,

Cemil
 
Cemil Örüm wrote:

Hi Cemil,
can anybody tell me, how I can change the header and the footer of a
word-document with c# ?
I already know, how to open word and how to create a document and paste text
into it, but I cannot access the header/footer.

Try to record a VBA Macro and then analyse the source code Excel
creates. It should be similar to the code you have to write in your C#
program.

HTH,

Michael
 
Well I found an example for VB:
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range.InsertAfter
"My Text"

But C# does not know 'wdHeaderFooterPrimary'. How can I do that in C# ?

Cemil
 
Back
Top