Ver Mensaje Individual
  #5  
Antiguo 28-09-2007
JAVH JAVH is offline
Miembro
 
Registrado: mar 2007
Posts: 17
Reputación: 0
JAVH Va por buen camino
Si, no te puedes mover libremente como si fuera una pantalla de DOS, solamente por el texto, donde sí puedes moverte libremente es para insertar objetos:

Código para insertar una imagen (tomado también de areabuilder), lo probé y funciona incluso con jpegs.

Código:
#include <comobj.hpp> 
// En versiones anteriores a la 6 ademas la siguiente: 
// #include <utilcls.h>

inline float MmToPoints(float mm) {return mm * 2.83464567;}

void __fastcall TForm1::Button1Click(TObject *Sender)
{
Variant word = GetActiveOleObject("Word.Application"); 
Variant doc = word.OlePropertyGet("ActiveDocument"); 

Variant sections = doc.OlePropertyGet("Sections"); 
Variant footers = sections.OlePropertyGet("First").OlePropertyGet("Headers"); 
Variant footer = footers.OleFunction("Item", 1 /*wdHeaderFooterPrimary*/); 

Variant shapes = footer.OlePropertyGet("Shapes"); 
Variant shape = shapes.OleFunction("AddPicture", 
    "c:\\dir\\imagen.bmp", // ruta a la imagen 
    false,                 // Vincular imagen al documento? 
    true);                 // Guardar la imagen vinculada con el documento? 

// Coordenadas relativas al borde de la página 
//  en este ejemplo a 100 mm. del borde izquierdo y a 10 mm del superior 
shape.OlePropertySet("RelativeHorizontalPosition", 1 /*wdRelativeHorizontalPositionPage*/); 
shape.OlePropertySet("Left", MmToPoints(100)); 
shape.OlePropertySet("RelativeVerticalPosition", 1 /*wdRelativeVerticalPositionPage*/); 
shape.OlePropertySet("Top", MmToPoints(10));
}
Responder Con Cita