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

Allows to define password for the current Word document.

Two password kinds exist :

- One to open a document.

- Another to allows its modification.

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('WSETPASSWD')

CHGVAR

VAR(&PARM1) VALUE('

Type="Password type"
;PWD="Password"

')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

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

&PARM2 &RESULT)

 

Parameters

Parameters

 

Parm1

Type is the type of password to add to the document:

*DOCPWD to specify the password at the opening

*WRTPWD for the one allowing the writing.

The password is given by the keyword PWD.

 

 

Example

 

LNCCMD   CMD(WOPENFILE) PARM1('C:\A\Test.docx')

LNCCMD   CMD(WSETPASSWD) PARM1('Type=""*DOCPWD";PWD="aura"')          

Note

Opening a password-protected Word document, with WOPENFILE for example, will make Word visible and the appearance of a popup that will interfere with Launcher in service mode, if we do not specify the password in the command.

 

To avoid having a popup, you must specify the password with WOPENFILE:

LNCCMD     CMD(WOPENFILE) PARM1('C:\A\Test_WSETVAR2.docx') +  

                PARM2('*DOCPWD=aura')