Consultor Eletrônico



Kbase 18788: How to insert a file into a Word Document (ActiveX example)
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Verified

GOAL:

How to insert a file into a Word Document (ActiveX example)

FIX:

The following sample code shows how to create a new document Word and insert a file (text file) into it.

DEFINE VARIABLE oServer AS COM-HANDLE NO-UNDO.

CREATE "Word.Application" oServer.

oServer:Visible = True.

oServer:Documents:Add().

oServer:Selection:InsertFile("C:\SAMPLE.TXT").

oServer:Quit().

RELEASE OBJECT oServer.