Insert Files in Word Document

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?
 
M

macropod

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top