par Stephane Maillard » 19 Juin 2003 à 14:03
Re,In a document in Edit mode, creates an OLE object in the current rich text field.Remarque CreateObject is not supported under OS/2, under UNIX, and on the Macintosh.Defined inNotesUIDocumentSyntaxSet handleV = notesUIDocument.CreateObject( [ name$ [ , type$ _ [ , filePath$ ] ] ] )Parametersname$String. Optional. The name you want to use to refer to the object.type$String. Optional. The type of object you want to create. The type you specify must correspond to an entry in the OLE registry and is case-sensitive. The method creates an empty instance of the specified object type. If you specify a type, you must omit the filePath$ parameter.filePath$String. Optional. The path and file name of the source document you want to use to create an object. The method creates an object from the file. If you specify a file path, you must specify an empty string ("") for the type$ parameter.Return valuehandleVVariant. A handle to the OLE object.UsageYou must specify either a type$ or a filePath$, but not both. If you specify a filePath$, you create the object in a rich text field. You must, however, code a GetObject statement to give LotusScript a handle on the object.The current document must be open in Edit mode and the cursor must be in an editable rich text field.With no parameters, this method displays the Create Object dialog box, which allows the user to select the object to create.Exemple :This script creates a new, blank Lotus 123 worksheet object in the Description field of the current document. Lotus123.Workbook.97 must be in the OLE registry.Dim workspace as New NotesUIWorkspaceDim uidoc as NotesUIDocumentSet uidoc = workspace.CurrentDocumentCall uidoc.GotoField( "Description" )Call uidoc.CreateObject("Quarterly Reports", "Lotus123.Workbook.97")[%sig%]
Cordialement
Stéphane Maillard