COMAccessors           package:RDCOMClient           R Documentation

_C_O_M _O_b_j_e_c_t _A_c_c_e_s_o_r_s

_D_e_s_c_r_i_p_t_i_o_n:

     These operators provide a more S-like syntax for accessing methods
     and properties in a dynamic COM object. One calls a COM object
     method using the '$' operator. The values of COM object properties
     are retrieved and set using '[[' and '[[<-', respectively.

_V_a_l_u_e:

     Setting a property returns 'NULL'.

     Invoking a method and getting a property value returns an S object
     representing the COM value. Primitive COM values are converted to
     the corresponding S objects. COM objects are returned as
     COMIDispatch objects.

_M_e_t_h_o_d_s:



     _x = "_C_O_M_I_D_i_s_p_a_t_c_h" the COMIDispatch object whose method or
          property is to be invoked.

_A_u_t_h_o_r(_s):

     Duncan Temple Lang (duncan@wald.ucdavis.edu)

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.omegahat.org/RDCOMClient> <URL:
     http://www.omegahat.org/RDCOMServer> <URL:
     http://www.omegahat.org/SWinTypeLibs> <URL:
     http://www.omegahat.org/SWinRegistry>

_S_e_e _A_l_s_o:

     '.COM' 'COMCreate'

     'COMList-class' 'COMTypedList-class' 'COMTypedNamedList-class'

_E_x_a_m_p_l_e_s:

      e <- COMCreate("Excel.Application")

       # Boolean/Logical
      e[["Visible"]]
       # Setting a value.
      e[["Visible"]] <- TRUE

       # String
      e[["Path"]]
      e[["Version"]]

       # Double
      e[["Width"]]

       # Long
      e[["SheetsInNewWorkbook"]]
      
       # Object
      books <- e[["Workbooks"]]

      books$Add()

       # Use this as a container, so can have integer indices, 1-based.
      books[[1]]
      e[["Workbooks"]][[1]]

     ## Not run: 
      books$Open("C:\mySheet.xls")
     ## End(Not run)

      e$CheckSpelling("This is a spell check") # okay
      e$CheckSpelling("This is a spell chck") # error

     ## Not run: 
      
      e$SaveWorkspace()
     ## End(Not run)
      e$Quit()

      rm(list= c("e", "books"))
      gc()

