Mensaje    Asunto: Bordes de tablas de MSWord Responder citando

Hola.

Buscando en el foro he visto el enlace
Cita:
https://cppbuilder.es/viewtopic.php?t=10141
y después de probarlo con variantes no consigo que me funcione. Compila y da un error en tiempo de ejecución. Me dice algo así como que la variable no es del tipo requerido. ¿Alguna ayuda?
Pongo algo de código:
Código:
//-----------------------------------------------------------------------------------
//****************** SERVIDOR WORD *******************
//-----------------------------------------------------------------------------------
class OJPOWord{
public:
  bool Visible;
  Variant vWord,                                      //* MSWord (TWord)
          vDocs,                                      //* Documentos (TCollection)
          vDoc,                                       //* Documento (TDocument)
          vBMarks,                                    //* Libros marcas (TCollection)
          vBMark,                                     //* Libro marcas (TBookMark)
          vRange,                                     //* Rango
          vInLineShapes,                              //* Formas en línea (TCollection)
          vInLineShape,                               //* Forma en línea (TInLineShape)
          vShapes,                                    //* Formas (TCollection)
          vShape,                                     //* Forma (TShape)
          vStyles,                                    //* Estilos (TCollection)
          vFont,                                      //* Fuente (TFont)
          vParFormat,                                 //* Formato de párrafo
          vTables,                                    //* Tablas (TCollection)
          vTable,                                     //* Tabla (TTable)
          vBorders,                                   //* Bordes (TCollection)
          vBorder;                                    //* Borde (TBorder)
···
  unsigned int BordesTabla();
};
//-----------------------------------------------------------------------------------

#endif


//-----------------------------------------------------------------------------------
//********** FORMATEADO DE BORDES DE TABLA ***********
//-----------------------------------------------------------------------------------
unsigned int OJPOWord::BordesTabla(){
  ShowMessage("Hola 1");
/*
  vTables=vWord.OlePropertyGet("ActiveDocument").OlePropertyGet("Tables");
//  vTable=vTables.OleFunction("Item",1);
  vTable=vTables.Exec(Function("Item")<<1);
*/
//************* Obtengo el objeto bordes *************
//  ShowMessage(AnsiString((int)vTables.OlePropertyGet("Count")));
  ShowMessage("Hola 2");
//  vBorders=vTable.OlePropertyGet("Borders");
  vBorders=vTable.Exec(PropertyGet("Borders"));


/*
  vDoc=vWord.OlePropertyGet("ActiveDocument");
  vTables=vDoc.OlePropertyGet("Tables");
  vRange=vWord.OlePropertyGet("Selection").OlePropertyGet("Range");
  vTable=vTables.Exec(Procedure("Add")<<vRange<<5<<9);
*/


//******* Añado el borde exterior de la tabla ********
//*** - Borde izquierdo de la tabla                ***
  ShowMessage("Hola 3");
  vBorder=vBorders.OleFunction("Item",brIzquierdo);
  ShowMessage("Hola 4");
  vBorder.OlePropertySet("LineStyle",elSencillo);
  ShowMessage("Hola 5");
  vBorder.OlePropertySet("LineWidth",gl100Pts);
  ShowMessage("Hola 6");
//*** - Borde superior de la tabla                 ***
  vBorder=vBorders.OleFunction("Item",brSuperior);
  vBorder.OlePropertySet("LineStyle",elSencillo);
  vBorder.OlePropertySet("LineWidth",gl100Pts);
//*** - Borde derecho de la tabla                  ***
  vBorder=vBorders.OleFunction("Item",brDerecho);
  vBorder.OlePropertySet("LineStyle",elSencillo);
  vBorder.OlePropertySet("LineWidth",gl100Pts);
//*** - Borde inferior  de la tabla                ***
  vBorder=vBorders.OleFunction("Item",brInferior);
  vBorder.OlePropertySet("LineStyle",elSencillo);
  vBorder.OlePropertySet("LineWidth",gl100Pts);
//** Añado las líneas de separación entre columnas ***
  vBorder=vBorders.OleFunction("Item",brVertical);
  vBorder.OlePropertySet("LineStyle",elSencillo);
  vBorder.OlePropertySet("LineWidth",gl025Pts);
//  vBorder.OlePropertySet("Color",clRed);
//**** Añado las líneas de separación entre filas ****
  vBorder=vBorders.OleFunction("Item",brHorizontal);
  vBorder.OlePropertySet("LineStyle",elSencillo);
  vBorder.OlePropertySet("LineWidth",gl025Pts);
//  vBorder.OlePropertySet("Color",clRed);
  return 1;
}
Un saludo.
_________________
Nunca digas "Es imposible" sin intentarlo antes.