Instancier des objets COM avec Tcom

 

GS - Cette page est une liste d'instanciation d'objets COM suivant l'application sous Windows. Ce qui correspond aux quelques premières lignes pour accéder à un programme en utilisant Tcom [1]. Vous pouvez ajouter des liens vers une nouvelle page avec des exemples de codes plus complets en dessous de chaque application.


- Word

 package require tcom
 set application [::tcom::ref createobject "Word.Application"]
 set documents [$application Documents]

Voir aussi: Word avec Tcl et Tcom, msdoc

- Excel

 package require tcom
 set application [::tcom::ref createobject "Excel.Application"]
 set workbooks [$application Workbooks]
 set workbook [$workbooks Add]
 set worksheets [$workbook Worksheets]

Voir aussi: Excel avec Tcl et Tcom

- Powerpoint

 package require tcom
 set application [::tcom::ref createobject "Powerpoint.Application"]
 set presentation [$application Presentations]

- Access

 package require tcom
 set application [::tcom::ref createobject "Access.Application"]

- Writer

 package require tcom
 set application [::tcom::ref createobject "com.sun.star.ServiceManager"]
 set desktop [$application createInstance com.sun.star.frame.Desktop]
 array set arguments {}
 set documents [$desktop LoadComponentFromUrl private:factory/swriter _blank 0 [parray arguments]]

- Calc

 package require tcom
 set application [::tcom::ref createobject "com.sun.star.ServiceManager"]
 set desktop [$application createInstance com.sun.star.frame.Desktop]
 array set arguments {}
 set worksheets [$desktop LoadComponentFromUrl private:factory/scalc _blank 0 [parray arguments]]

- Impress

 package require tcom
 set application [::tcom::ref createobject "com.sun.star.ServiceManager"]
 set desktop [$application createInstance com.sun.star.frame.Desktop]
 array set arguments {}
 set presentation [$desktop LoadComponentFromUrl private:factory/simpress _blank 0 [parray arguments]]

- Draw

 package require tcom
 set application [::tcom::ref createobject "com.sun.star.ServiceManager"]
 set desktop [$application createInstance com.sun.star.frame.Desktop]
 array set arguments {}
 set drawing [$desktop LoadComponentFromUrl private:factory/sdraw _blank 0 [parray arguments]]

Voir aussi: Open Office avec Tcl et tcom


 package require tcom
 set ie [::tcom::ref createobject InternetExplorer.Application.1]
 $ie Visible True
 $ie Navigate "http://www.tcl.tk"

 package require tcom
 set application [::tcom::ref createobject "Visio.Application"]

 package require tcom
 set application [::tcom::ref createobject "Outlook.Application"]

 package require tcom
 set application [::tcom::ref createobject "MSDev.Application"]

 package require tcom
 set application [::tcom::ref createobject "CodeWarrior.CodeWarriorApp"]

 package require tcom
 set application [::tcom::ref createobject "GoogleEarth.ApplicationGE"]

Voir aussi: Dominer le monde avec Tcl, Tcom et Google Earth


 package require tcom
 set application [::tcom::ref createobject "BusinessObjects.Application"]
 application visible true
 application interactive true
 set documents [$application documents]

 package require tcom
 set ::application [::tcom::ref createobject "PDFCreator.clsPDFCreator"]

 package require tcom
 set application [::tcom::ref createobject "AutoCAD.Application"]
 set docs [$application Documents]

 package require tcom
 set application [::tcom::ref createobject "CATIA.Application"]
 set docs [$application ActiveDocument.Product]

 package require tcom
 set application [::tcom::ref createobject "SldWorks.Application"]
 set docs [$application ActiveDoc]

 package require tcom
 set application [::tcom::ref createobject "Rhino3.Application"]
  package require tcom
  set application [::tcom::ref createobject "Photoshop.Application"]

  package require tcom
  set application [::tcom::ref createobject "Illustrator.Application"]

 package require tcom
 set application [::tcom::ref createobject "Indesign.Application"]

  package require tcom
  set application [::tcom::ref createobject "Canvas.Application"]

 package require tcom
 set application [::tcom::ref createobject "LabView.Application"]

 package require tcom
 set application [::tcom::ref createobject "Matlab.Application"]

 package require tcom
 set application [::tcom::ref createobject "SigmaPlot.Application"]
 set notebooks [$application Add]

  package require tcom
  set iTunes [::tcom::ref createobject "iTunes.Application"]

  package require tcom
  set application [::tcom::ref createobject "AWREM32.Application"]

  package require tcom
  set app [::tcom::ref createobject "SAS.Application"]
  $app Submit "%put Hello, World!;"
  $app Quit