Insert Files in Word Document

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a code that merge some .doc files into one .doc file. the code is just
like this:

foreach(string mFile in mFiles)
{
documentoFinal.Application.Selection.InsertFile(mFile, ref vazio, ref
vazio, ref vazio, ref vazio);
documentoFinal.Application.Selection.InsertBreak(ref oBreak);
}

But the format of the Headers and Footnotes cam always with the first file
that I input! Why he do that and how can I solve this problem?
 
Hi Marcos,

To have different headers and footers, each added document would have to
follow a section break with the 'same as previous' value set to false for
both the header and the footer. Then you can add the headers and footers for
each document.

Cheers
 
Hey Macropod!

Thanks for your help, but I did not understood wher should I change this
value you called "'same as previous' value". I looked in the InsertFile and
in the InsertBreak, but that wasn´t a parameter with that name.

I tried to insert a section break of the type
Word.WdBreakType.wdSectionBreakContinuous, but still it doesn´t work.

Thanks in advance
Marcos
 
Back
Top