userbb
userbb

Reputation: 1874

WordApplication Document add text

How to paste some text to Word document if i have handle to TWordDocument or _Document?

Upvotes: 0

Views: 494

Answers (1)

Sertac Akyuz
Sertac Akyuz

Reputation: 54832

Paste to the Range object of the document:

Document.Range(EmptyParam, EmptyParam).Paste;

or

Word.ActiveDocument.Range(EmptyParam, EmptyParam).Paste;


You can tell where to paste:

var
  R: OleVariant;
..
  R := 20;
  Document.Range(R, R).Paste;

Upvotes: 4

Related Questions