ztdoc:='1.doc';
W1.Documents.open(ztdoc,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam);
worddocument1.connectto(W1.Documents.item(index));
num:=worddocument1.paragraphs.Count;
s:=worddocument1.paragraphs.Item(num).range.start;
d:=worddocument1.paragraphs.Item(num).range.end_;
ws:='2.doc';
worddocument1.Range(s,d).InsertFile(ws,r1,r2,r3,r4);
W1.Documents.open(ztdoc,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam);
worddocument1.connectto(W1.Documents.item(index));
num:=worddocument1.paragraphs.Count;
s:=worddocument1.paragraphs.Item(num).range.start;
d:=worddocument1.paragraphs.Item(num).range.end_;
ws:='2.doc';
worddocument1.Range(s,d).InsertFile(ws,r1,r2,r3,r4);
worddocument1.range.copy;
worddocument2.sentences.last.paste;