Hello
Hi Tahir
Document doc = new Document(MyDir + "Main Template.doc");
Document Leader = new Document(MyDir + "Leader.doc");
Document Body = new Document(MyDir + " Body.doc");
Document Trailer = new Document(MyDir + "Trailer.doc");
Double leftindent = doc.LastSection.Body.LastParagraph.ParagraphFormat.LeftIndent;
doc.FirstSection.Body.AppendParagraph("");
DocumentBuilder builder = new DocumentBuilder(doc);
builder.MoveToDocumentEnd();
builder.InsertDocument(Leader, ImportFormatMode.KeepSourceFormatting);
builder.InsertDocument(Body, ImportFormatMode.KeepSourceFormatting);
builder.InsertDocument(Trailer, ImportFormatMode.KeepSourceFormatting);
foreach (Paragraph paragaph in doc.GetChildNodes(NodeType.Paragraph, true))
{
paragaph.ParagraphFormat.LeftIndent = leftindent;
}
Shape shape = (Shape)doc.FirstSection.Body.FirstParagraph.GetChild(NodeType.Shape, 0, true);
foreach (Paragraph paragaph in shape.GetChildNodes(NodeType.Paragraph, true))
{
paragaph.ParagraphFormat.LeftIndent = 0.0;
}
LayoutCollector collector = new LayoutCollector(doc);
foreach (Paragraph paragaph in doc.GetChildNodes(NodeType.Paragraph, true))
{
if (collector.GetStartPageIndex(paragaph) > 1)
paragaph.ParagraphFormat.LeftIndent = 0.0;
}
doc.Save(MyDir + "Out.doc");
Thanks a lot, Tahir. This really helps. Appreciate the quick turn around on this issue.
Hi Tahir