Ver Mensaje Individual
  #1  
Antiguo 14-11-2006
Avatar de johurgi
johurgi johurgi is offline
Miembro
 
Registrado: jul 2006
Posts: 95
Reputación: 18
johurgi Va por buen camino
Word Document

Hola a tod@s de nuevo:

Mi duda es la siguiente tengo en mi aplicacion 2 dbrichedit en los cuales el texto que tienen, tiene formato. Al intentar crear un documento de word, puedo insertar el texto pero no me guarda el formato que tenia en los dbrichedit, me los cambia al formato standard de word.El codigo es el siguiente:

Código:
var
i: Integer;
f: olevariant;
worddoc:tworddocument;
begin
  try
    worddoc := TWordDocument.Create(nil);
    worddoc.Range.FormattedText.InsertAfter(dbrichedit4.Text);
    worddoc.range.InsertParagraphafter;
    worddoc.range.InsertParagraphafter;
    worddoc.Range.FormattedText.InsertAfter(dbrichedit3.Text);
    worddoc.range.InsertParagraphafter;
    if fileexists('C:\prueba.doc') then DeleteFile('C:\prueba.doc');
    f:='C:\prueba.doc';
    worddoc.Saveas(f);
  except
    ShowMessage('No se ha podido generar el documento de word.');
  end;
end;
PD:si alguien me supiera decir como puedo insertar imagenes dentro del documento desde la base de datos, tambien se lo agradeceria.

Gracias de antemano.
Responder Con Cita