Como Insertar una imagen como Header en WORD

Post Reply
User avatar
Blessed
Posts: 243
Joined: Wed Sep 19, 2007 4:32 pm
Location: Honduras, C.A.
Contact:

Como Insertar una imagen como Header en WORD

Post by Blessed »

Hola a Todos:
Estoy trabajando en un agregado a una programa de un cliente.
Ellos tienen uns imagenes, que colocan como Header (Encabezado) en Word.
Ya creo y guardo datos en Word de la siguiente Manera.

Code: Select all

oWord := TOleAuto():New("Word.Application")
oWord:Documents:Add() && Agregando un nuevo documento
oSelection := oWord:Selection  && Tomando la seleccion activa

WITH OBJECT oSelection
            :Font:Name="Times New Roman"
            :Font:Size=12
            :Font:Bold=.T.
            :Font:Underline=.T.
            :ParagraphFormat:Alignment = 1    && Centrar
            :TypeText(cTituloExa+CRLF)
END WITH

oWord:ActiveDocument:SaveAs( oApp:Ruta_WORD + "\" + MOVI->EXAMEN_NUM )
oWord:Quit()
 
Con esto resumo la ayuda que he recibido en el foro, como puedo insertar un Header?
Alguien lo ha Hecho?
_ A. Martinez
http://www.multisofthn.com
Honduras, Centro America
xHarbour Enterprise 1.2.2, Fivewin 13.06
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Como Insertar una imagen como Header en WORD

Post by anserkk »

Try this, I have not tested myself

Code: Select all

LOCAL oHead  := oActiveDoc:Sections[1]:Headers[1]    // Header Section
LOCAL oRange := oHead:Range()
oRange:Collapse(1)       // Insert point at the beginning of the range
oRange:InlineShapes:AddPicture( "C:\Pictures\TestPic.JPG" )
Regards
Anser
Post Reply