Ole4D Methods

OCCreaFromProgId(p_AreaVar;p_ProgId)



Creates the Ole object identified by Object Programmatic ID. Object is created in the plug-in area passed as parameter.
The object who has the Class ID specified as parameter must be installed on the local machine. There are 2 kinds of Programmatic ID: version dependent and version independent(example.: version independent="Word.Document" and version dependent "Word.Document.7").
If you cannot create the OleObject using the version independent ProgId, you can try to use the version dependent ProgId.

Parameters
Parameter Type   Description
p_AreaVar Longint -> Variable of the plug-in area.
p_ProgId String -> Programmatic identifier of the Ole object you want to embed.This can be the version dependent or the version independent programmatic identifier.


Return Values
0 – The method call was successful.
If the method call was not successful the return value is non zero. For more information call OCLastError.

Remarks
The object is created in the inactive state. The user interface of the object like toolbars and menus is not shown at this time. To enable and show the user interface of the object call OCActivate.

Example
$i := OCCreaFromProgId(OlPlugIn,“WordDocument”)
If ($i#0)
ALERT (String ($i) +OCSysMessage ($i))
Else
  $i:=OCActivate(OlePlugIn)
End if


See Also
OCCreaLinkToFile, OCCreaFromCLSID, OCCreaFromFile, OCCreaFromBlob, OCDestroyObject, OCActivate