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

 Allows to create an OLE object instance.

 

Syntax

 

CHGVAR

VAR(&CMD) VALUE('OLECREATE')

CHGVAR

VAR(&PARM1) VALUE('"Reference towards the object"')

CHGVAR

VAR(&PARM2) VALUE(' ')

CALL

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

&PARM2 &RESULT)

 

  Parameters

 

Parameters

 

Parm1

Reference to the application for which you want to create an instance.
For instance, to create a Microsoft Access instance, specify :

"Access.application".

To create a Lotus instance :

"Notes.NotesSession".

Object references are located in Windows registry, under the HKEY_CLASSES_ROOT key.

 

RESULT


At return, the &RESULT parameter contains the identifier of the instance of the created object, on 10 characters.

This identifier will be used by the OLECALL command.

 

 

Use of this command requires a good Windows OLE programming knowledge as well as a good knowledge of the object to communicate with.

 

Example

 

  LNCCMDR    CMD(OLECREATE) PARM1(ACCESS.APPLICATION) + 

               RESULT(&RES)

                             

  LNCCMD     CMD(OLECALL) PARM1(&RES) +                     

               PARM2('NewCurrentDatabase("LAUNCH24.MDB")')  

                                                            

  LNCCMD     CMD(OLECALL) PARM1(&RES) +                     

               PARM2('DoCmd.TransferText(0;;"SP_CUST34";"C+ 

               :\AuraData\ACCESS_2010_test\LNC003_virgule.+ 

               TXT";true;;1200)')  

 

  LNCCMD     CMD(OLERELEASE) PARM1(&RES)     

                     

See also

OLECALL