Problemas na hora de imprimir no word

Delphi

06/01/2005

GALERA EU TO TENDO UM PROBLEMINHA NO MEU PROGRAMA
O MEU PROGRAMA FOI TODO FEITO XP.
É UM PROGRAMINHA DE LAUDO EU USO O WORD PARA IMPRIMIR O LAUDO
E USO ESSE CÓDIGO
Try

Documento := CreateOleObject(´Word.Basic´);
Documento.FileNew;
If PrintButton.Tag = 2
Then
Documento.AppShow;
Documento.Bold;
Documento.Insert(´Nome do Paciente´+#9+´: ´+F_Entrada.Ed_Nome_Pac.Text + 13);//8
Documento.Bold;
Documento.Insert(´Medico Solicitante´+9+ ´: ´+ F_Entrada.Ed_Med_Sol.Text + 13);//9
Documento.Bold;
Documento.Insert(´Convênio´+9+9+´: ´+ F_Entrada.Ed_Conv.Text + 13);//10
Documento.Bold;
Documento.Insert(´Data´+9+9+9+´: ´+ F_Entrada.Ed_Dt_Exame.Text + 13); //11
Documento.Bold;
Documento.Insert(´Exame Número´+9+´: ´+ COPY(F_Entrada.Ed_Num_Exa.Text,1,5)+ ´/´+ COPY(F_Entrada.Ed_Num_Exa.Text,6,lENGTH(F_Entrada.Ed_Num_Exa.Text))+13);//13
Documento.Bold;
Documento.Insert(#13); //14
Documento.Insert(13); //15

Documento.Centerpara;
Documento.Centerpara;
Documento.Bold;
Documento.FontSize(15);
Documento.Centerpara;
Documento.UNDERLINE;
Documento.Insert(Ed_Exame.Text);//16
Documento.Centerpara;
Documento.Centerpara;
Documento.Insert(13);
Documento.Bold(False);
Documento.JustifyPara;
Documento.Insert(13);
Documento.Insert(13);
I := 0;

strTexto:=Editor.text;
While (POS(´<´,strTexto) > 0) or (POS(´>´,strTexto) > 0 ) do
Begin
Posicao1 := POS(´>´,strTexto);
Posicao2 := POS(´<´,strTexto);
Delete(strTexto,posicao1,1);
Delete(strTexto,posicao2,1);
End;

posI := pos(´´,strTexto);
posN := pos(´´,strTexto);
posS := pos(´´,strTexto);

strTag := ´´;
posOk := 9999999;

while (posI > 0) OR ((posN > 0)) OR ((posS > 0)) do
begin

if (posI < posOk) AND (posI > 0) then
begin
strTag := ´I´;
posOk := posI;
end;

if (posN < posOk) AND (posN > 0) then
begin
strTag := ´N´;
posOk := posN;
end;

if (posS < posOk) AND (posS > 0) then
begin
strTag := ´S´;
posOk := posS;
end;

if (strTag = ´I´) then //Italico
begin
Italico(StrTexto,posOk,Documento,0);
end;

if (strTag = ´N´) then //Negrito
begin
Negrito(StrTexto,posOk,Documento,0);
end;

if (strTag = ´S´) then //Sublinhado
begin
Sublinhado(StrTexto,posOk,Documento,0);
end;

posI := pos(´´,strTexto);
posN := pos(´´,strTexto);
posS := pos(´´,strTexto);

strTag := ´´;
posOk := 9999999;
end;
Documento.Bold(False);
Documento.JustifyPara;
Documento.JustifyPara;
documento.insert(strTexto);

Documento.Insert(#13);
Documento.Bold(True);
Documento.font(´lucida HandWrinting´);
//Documento.CenterPara;
Documento.JustifyPara;
Documento.FontSize(10);//1
Documento.Insert(´OBS : Este é um método de exame complementar e como tal deverá ser analisado pelo médico solicitante, para correlação clínica e decisão terapêutica. ´);

Documento.Insert(#13);//3
Documento.Insert(13);//4
Documento.Insert(13);//5
Documento.CenterPara;//6
Documento.Centerpara;//7
Documento.Bold;
Documento.Insert(´___________________________________´13);//9
Documento.Centerpara;
Documento.Bold;
Documento.FontSize(10);
Case DM1.Q_Med_AssSEXO.AsInteger Of
1 : Documento.Insert(´Dr.ª : ´+ F_Entrada.Ed_Med_Ass.Text+13); //11
2 : Documento.Insert(´Dr.: ´+ F_Entrada.Ed_Med_Ass.Text+13);
End;
Documento.Centerpara;
Documento.Bold;
Documento.FontSize(10);
Documento.Insert( ´CRM : ´ + DM1.Q_Med_AssCRM.AsString);//12
If PrintButton.Tag = 1
Then
Begin
For I := 1 to StrToInt(Ed_Imp_Paginas.Text) do
Begin
Documento.FilePrint;
Application.ProcessMessages;
Sleep(1000);
End;
Documento.FileExit(2);
End;

Finally
PrintButton.Enabled := True;
End;


no xp imprimi que é uma maravilha
porem quando eu coloco o programa para rodar no 98
da o seguinte problema (Mensagem)

´ versão incompatível do procedimento STUB DE RPC ´

OBs o word que ta nas duas máquinas é o word 2000 e a base de dados é MySql e a versão do Delphi é a 7


Felipemarinho

Felipemarinho

Curtidas 0

Respostas

Massuda

Massuda

06/01/2005

Parece ser um problema relacionado com a instalação de DLLs erradas... dê uma olhada nesses links (em inglês):

:arrow: [url=http://support.microsoft.com/default.aspx?scid=kb;en-us;321915]Knowledge Base da Microsoft[/url]

:arrow: [url=http://consumer.installshield.com/kb.asp?id=Q108188]Suporte do InstallShield[/url]


GOSTEI 0
POSTAR