Package com.jacob.com

Examples of com.jacob.com.Dispatch


          if (i % 10 == 0) {
            System.out.println(Thread.currentThread().getName()
                + ": Iteration " + i);
            System.out.flush();
          }
          Dispatch comPresentations = Dispatch.get(comPowerpoint,
              "Presentations").toDispatch();
          Dispatch comPresentation = Dispatch.call(
              comPresentations,
              "Open",
              getWindowsFilePathToPackageResource("test"
                  + threadID + ".ppt", this.getClass()),
              new Integer(0), new Integer(0), new Integer(0))
View Full Code Here


          // show the type
          argString += "(" + argType + ")";
        }
        argString += "=";
        if (argType == Variant.VariantDispatch) {
          Dispatch foo = (args[i].getDispatch());
          argString += foo;
        } else if ((argType & Variant.VariantBoolean) == Variant.VariantBoolean) {
          // do the boolean thing
          if ((argType & Variant.VariantByref) == Variant.VariantByref) {
            // boolean by ref
View Full Code Here

  public void testPowerpoint() {
    ComThread.InitMTA();

    ActiveXComponent component = new ActiveXComponent(
        "Powerpoint.Application");
    Dispatch comPowerpoint = component.getObject();

    try {
      PowerpointTestThread[] threads = new PowerpointTestThread[NUM_THREADS];
      for (int i = 0; i < NUM_THREADS; i++) {
        threads[i] = new PowerpointTestThread(i + 1, comPowerpoint);
View Full Code Here

    try {

      System.out.println("version=" + axc.getProperty("Version"));
      System.out.println("version=" + Dispatch.get(axc, "Version"));
      axc.setProperty("Visible", true);
      Dispatch workbooks = axc.getPropertyAsComponent("Workbooks");
      Dispatch workbook = Dispatch.get(workbooks, "Add").toDispatch();
      Dispatch sheet = Dispatch.get(workbook, "ActiveSheet").toDispatch();
      hookupListener(sheet, excelSheetProgramId, typeLibLocation);
      Dispatch a1 = Dispatch.invoke(sheet, "Range", Dispatch.Get,
          new Object[] { "A1" }, new int[1]).toDispatch();
      Dispatch a2 = Dispatch.invoke(sheet, "Range", Dispatch.Get,
          new Object[] { "A2" }, new int[1]).toDispatch();
      System.out.println("Inserting value into A1");
      System.out.println("Inserting calculation 2xA1 into A2");
      Dispatch.put(a1, "Value", "123.456");
      Dispatch.put(a2, "Formula", "=A1*2");
 
View Full Code Here

        // should we get this?
      }

      String scriptCommand = getSampleVPScriptForEval();
      // get a thread-local Dispatch from sCon
      Dispatch sc = script.sCon.toDispatch();

      // call a method on the thread-local Dispatch obtained
      // from the DispatchProxy. If you try to make the same
      // method call on the sControl object - you will get a
      // ComException.
View Full Code Here

      ActiveXComponent excel = new ActiveXComponent("Excel.Application");

      try {

        excel.setProperty("Visible", false);
        Dispatch workbooks = excel.getProperty("Workbooks")
            .toDispatch();

        Dispatch workbook = Dispatch.call(workbooks, "Open", path, // FileName
            3, // UpdateLinks
            false, // Readonly
            5, // Format
            password // Password
            ).toDispatch();

        Dispatch sheets = Dispatch.call(workbook, "Worksheets")
            .toDispatch();
        System.out.println("Before executa");
        executa(excel, sheets);
        System.out.println("After executa");
View Full Code Here

     *            valor a ser escrito na celula
     */
    public void informarValorCelula(String celula, Dispatch sheet,
        String valor) {
      System.out.println("Entered informarValorCelula");
      Dispatch cel = obterCelula(celula, sheet);
      Dispatch.put(cel, "Value", valor);
      System.out.println("Exiting informarValorCelula");
    }
View Full Code Here

     *            pasta da planilha que cont�m a c�lula
     * @return - conte�do da propriedade Value
     */
    public Variant obterValorCelula(String celula, Dispatch sheet) {
      System.out.println("Entered obterValorCelula");
      Dispatch d = obterCelula(celula, sheet);
      Variant returnedValue = Dispatch.get(d, "Value");
      System.out.println("Exiting obterValorCelula");
      return returnedValue;
    }
View Full Code Here

     * @return - referencia para um c�lula ou conjunto de c�lulas,
     *         dependendo do par�metro passado
     */
    public Dispatch obterCelula(String celula, Dispatch sheet) {
      System.out.println("Entered obterCelula");
      Dispatch d = Dispatch.invoke(sheet, "Range", Dispatch.Get,
          new Object[] { celula }, new int[1]).toDispatch();
      System.out.println("Exiting obterCelula");
      return d;
    }
View Full Code Here

     *            Referencia para conjunto de pastas da planilha
     */
    public void executa(ActiveXComponent xl, Dispatch sheets) {

      System.out.println("Entered private ExcellCallBack executa()");
      Dispatch sheet = Dispatch.call(sheets, "Item", "Plan1")
          .toDispatch();
      columnA = obterValoresRange("A1:A50", sheet);
      columnB = obterValoresRange("B1:B40", sheet);
      System.out.println("Exiting private ExcellCallBack executa()");
    }
View Full Code Here

TOP

Related Classes of com.jacob.com.Dispatch

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.