Documento no Word
Pessoal, preciso gerar um documento no work já tenho o documento modelo, mas não sei como proceder.
Inseri o WordApplication, mas qdo mando conectar dá erro dizendo ´Interface not Suported´
Valeu.
Inseri o WordApplication, mas qdo mando conectar dá erro dizendo ´Interface not Suported´
Valeu.
Marlon Spiess
Curtidas 0
Respostas
Marlon Spiess
25/11/2004
Pessoal, tanto o TWordApplication qto o TWordDocument retornam o erro ´Interface not Suported´.
Qual o meu erro ?
Segue o source
procedure TfPedido.CriaArquivo(Inicio, Fim : integer; Prefixo : string);
var
SaveChanges : OleVariant;
FileName : OleVariant;
field : OleVariant;
matchCase : OleVariant;
forwardsearch : OleVariant;
stop : OleVariant;
startrange : OleVariant;
endrange : OleVariant;
txtRange : Range;
Y, X : integer;
lstField,
fField : FormField;
st : string;
begin
SaveChanges := wdDoNotSaveChanges;
wapplication.Connect; // aqui está o erro
wapplication.Visible := false;
FileName := opdArquivo.FileName;
wapplication.Documents.OpenOld(FileName, EmptyParam, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, EmptyParam);
wdocument.ConnectTo(wapplication.ActiveDocument);
field := ´INICIO´;
lstField := wdocument.FormFields.Item(field);
Qual o meu erro ?
Segue o source
procedure TfPedido.CriaArquivo(Inicio, Fim : integer; Prefixo : string);
var
SaveChanges : OleVariant;
FileName : OleVariant;
field : OleVariant;
matchCase : OleVariant;
forwardsearch : OleVariant;
stop : OleVariant;
startrange : OleVariant;
endrange : OleVariant;
txtRange : Range;
Y, X : integer;
lstField,
fField : FormField;
st : string;
begin
SaveChanges := wdDoNotSaveChanges;
wapplication.Connect; // aqui está o erro
wapplication.Visible := false;
FileName := opdArquivo.FileName;
wapplication.Documents.OpenOld(FileName, EmptyParam, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, EmptyParam);
wdocument.ConnectTo(wapplication.ActiveDocument);
field := ´INICIO´;
lstField := wdocument.FormFields.Item(field);
GOSTEI 0
Rômulo Barros
25/11/2004
Veja [url=http://www.add-in-express.com/?ref1=adwords&ref2=adx#word]ESTE LINK[/url]
_____________________________________________
[b:eb888f288b][color=blue:eb888f288b]Utilize a Ferramenta de Pesquisa do Fórum[/color:eb888f288b][/b:eb888f288b]
Pesquisar pelos termos
_____________________________________________
[b:eb888f288b]Veja como[url=http://forum.clubedelphi.net/viewtopic.php?t=16976] OBTER RESPOSTAR RÁPIDAS[/url][/b:eb888f288b]
[b:eb888f288b]Veja as novas [url=http://forum.clubedelphi.net/viewtopic.php?t=59817]MUDANÇAS NA ESTRUTURA[/url] do site[/b:eb888f288b]
[b:eb888f288b]Leia sempre as [url=http://forum.clubedelphi.net/viewtopic.php?t=6689]REGRAS DE CONDUTA[/url][/b:eb888f288b]
_____________________________________________
[b:eb888f288b][color=blue:eb888f288b]Utilize a Ferramenta de Pesquisa do Fórum[/color:eb888f288b][/b:eb888f288b]
Pesquisar pelos termos
_____________________________________________
[b:eb888f288b]Veja como[url=http://forum.clubedelphi.net/viewtopic.php?t=16976] OBTER RESPOSTAR RÁPIDAS[/url][/b:eb888f288b]
[b:eb888f288b]Veja as novas [url=http://forum.clubedelphi.net/viewtopic.php?t=59817]MUDANÇAS NA ESTRUTURA[/url] do site[/b:eb888f288b]
[b:eb888f288b]Leia sempre as [url=http://forum.clubedelphi.net/viewtopic.php?t=6689]REGRAS DE CONDUTA[/url][/b:eb888f288b]
GOSTEI 0