![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Buscar | Temas de Hoy | Marcar Foros Como Leídos |
![]() |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
|
|
#1
|
|||
|
|||
|
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));
}
|
|
#2
|
|||
|
|||
|
tienes todita la razón el código funciona muy bien, te agradezco una vez mas tu ayuda, y por si algo ya me estoy defendiendo con la pos del cursor a punta de tabuladores.
__________________
documentos de word |
![]() |
| Herramientas | Buscar en Tema |
| Desplegado | |
|
|
Temas Similares
|
||||
| Tema | Autor | Foro | Respuestas | Último mensaje |
| Posicionar cursor en word | nacho | Servers | 9 | 10-08-2006 13:30:09 |
| Ubicar cursor en un TEdit | supermilloriver | OOP | 1 | 26-07-2006 00:19:52 |
| Ubicar un messagebox en pantalla | Ricardo León | Varios | 2 | 26-09-2005 15:01:03 |
| Ubicar REgistro insertado dentro de un BD | sierraja | Conexión con bases de datos | 1 | 20-04-2005 19:11:04 |
| Ubicar registro con Interbase | BlueSteel | Firebird e Interbase | 3 | 14-09-2004 01:05:44 |
|