PreviousNext
Help > Programming with LAUNCHER Office > LNCCMD commands > Commands list > WINSERTF command
WINSERTF command

Inserts an existing Word document into the active Word document.

The text formatting of the inserted document remains the same.

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('WINSERTF')

CHGVAR

VAR(&PARM1) VALUE('
File="Document name"
[;Directory="Directory path"]

[;Bookmark="Signet"]

[;Adjust=True/False]

[;Append=True/False]

[;range="range"]

[;Link=True/False]
[;DeleteBookmark=True/False/"Nom"]

[;AsText=True/False]

')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT)

MONMSG

MSGID(LNC0000) EXEC(GOTO CMDLBL(ERROR))

 

Parameters

 

Parameters

 

Parm1

File : Name of the file to insert. If the full path is specified, then the Directory parameter is not useful.

 

Directory: (Optional) This option specifies a path to the directory where the document to be inserted is located.
This directory path is added in front of the file name specified with the File option. This parameter is not needed if the full path is specified in the File parameter.

 

Bookmark : (Optional) Bookmark name where new document will be inserted.

Word preset bookmarks can be used.

 

Adjust: (Optional) If bookmarked positioning is requested by the Bookmark option, this option places the bookmark on all inserted text.

 

Append: (Optional) If bookmark positioning is requested by the Bookmark option, this option adds the contents of the document to be inserted to the current contents of the bookmark.

 

Link = True/False, default is false.

If Link is true, it is a link towards the file which is inserted. The modifications made to the file will be automatically deferred on the documents with which it is dependent.

 

Range : Range to insert from the source document. If the file to be inserted is a Word document, Range can represent a bookmark. If the file is an Excel document, Range can represent a range of cells

 

DeleteBookmark : If this option has the true value, then the bookmark specified by the option Bookmark is removed.

If this option contains a alpha numerical value, then the bookmarks will be removed as described by the order WBOOKMDEL.

If the inserted document itself contains bookmarks, they will be added to the current document, if their names do not already exist.

 

If AsText is true, then the file to be inserted must be text only. It will be inserted into the document as if it were typed. The format of characters and paragraphs will be the one applied at the insertion point.

 

 

 

Examples

 

Inserting a Word document at the end of the active Word document:

 

CHGVAR

VAR(&CMD) VALUE('WINSERTF')

CHGVAR

VAR(&PARM1) VALUE('File="c:\temp\lettre.docx";

Bookmark="\ENDOFDOC"')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

PGM(LNCCMD) PARM(&HANDLE &CMD &OPT &PARM1 +

&PARM2 &RESULT)

MONMSG

MSGID(LNC0000) EXEC(GOTO CMDLBL(ERROR))

 

Inserting a Word document at the location of the "State" bookmark:

 

LNCCMD     CMD(WINSERTF) +                                  

             PARM1('FILE="C:\temp\etat.docx";BOOKMARK="State"')