About that Any tutorials?
Day Thnx.
Fax Service COM Interfaces
. Simple operation, you can import the type library of fxscomex.dll library and use such code (based on this example
):
uses
ComObj, ActiveX, FAXCOMEXLib_TLB;
procedure TForm1.Button1Click(Sender: TObject);
var
I: Integer;
JobIDs: OleVariant;< br /> FaxServer: IFaxServer2;
FaxDocument: IFaxDocument2;
begin
try
FaxServer := CoFaxServer.Create;
FaxServer.Connect('');
FaxDocument := CoFaxDocument.Create;
FaxDocument.Body :='d:\Document.pdf';
FaxDocument.DocumentName :='Document name';
FaxDocument.Recipients.Add ('+1 (425) 555-4567','Bill');
FaxDocument.Sender.Name :='Bob';
FaxDocument.Sender.BillingCode := '23A54';
FaxDocument.Sender.Department :='Accts Payable';
FaxDocument.Sender.FaxNumber :='+972 (4) 555-9070';
JobIDs := FaxDocumen t.ConnectedSubmit(FaxServer);
for I := VarArrayLowBound(JobIDs, 1) to VarArrayHighBound(JobIDs, 1) do
ShowMessage('Job ID: '+ VarArrayGet(JobIDs, [ I]));
except
on E: EOleSysError do
ShowMessage(
Format('Sending of the fax failed! %s [%d]', [E.Message , E.ErrorCode])
);
end;
end;
Or the same without type library:
< pre>procedure TForm1.Button1Click(Sender: TObject);
var
I: Integer;
JobIDs: OleVariant;
FaxServer: OleVariant;
FaxDocument: OleVariant;< br />begin
try
FaxServer := CreateOleObject(‘FaxComEx.FaxServer’);
FaxServer.Connect(”);
FaxDocument := CreateOleObject(‘FaxComEx.FaxDocument ‘);
FaxDocument.Body :=’d:\Document.pdf’;
FaxDocument.DocumentName :=’Document name’;
FaxDocument.Recipients.Add(‘+1 (425 ) 555-4567′,’Bill’);
FaxDocument.Sender.Name :=’Bob’;
FaxDocument.Sender.Billin gCode := ’23A54′;
FaxDocument.Sender.Department :=’Accts Payable’;
FaxDocument.Sender.FaxNumber :=’+972 (4) 555-9070′;
JobIDs := FaxDocument.ConnectedSubmit(FaxServer);
for I := VarArrayLowBound(JobIDs, 1) to VarArrayHighBound(JobIDs, 1) do
ShowMessage(‘Job ID: ‘+ VarArrayGet(JobIDs , [I]));
except
on E: EOleSysError do
ShowMessage(
Format(‘Sending of the fax failed! %s [%d]’, [E .Message, E.ErrorCode])
);
end;
end;
Anyone knows how to use Windows 8 fax Sending faxes is real Delphi.. I mean I need to start Windows fax with numbers and pdf attachments.
Any tutorials on that?
Day Thnx.
For example, you can use Fax Service COM Interfaces
. For simple operations, you can import the fxscomex.dll library Type library and use code like this (based on this example
):
uses
ComObj, ActiveX, FAXCOMEXLib_TLB;
procedure TForm1.Button1Click(Sender: TObject);
var
I: Integer;
JobIDs: OleVariant;
FaxServer: IFaxServer2;
FaxDocument : IFaxDocument2;
begin
try
FaxServer := CoFaxServer.Create;
FaxServer.Connect('');
FaxDocument := CoFaxDocument.Create;
FaxDocument.Body :='d:\Document.pdf';
FaxDocument.DocumentName :='Document name';
FaxDocument.Recipients.Add('+1 (425) 555-4567', 'Bill');
FaxDocument.Sender.Name :='Bob';
FaxDocument.Sender.BillingCode := '23A54';
FaxDocument.Sender.Department :='Accts Payable' ;
FaxDocument.Sender.FaxNumber :='+972 (4) 555-9070';
JobIDs := FaxDocument.ConnectedSubmit(FaxServer);
for I := V arArrayLowBound(JobIDs, 1) to VarArrayHighBound(JobIDs, 1) do
ShowMessage('Job ID: '+ VarArrayGet(JobIDs, [I]));
except
on E: EOleSysError do
ShowMessage(
Format('Sending of the fax failed! %s [%d]', [E.Message, E.ErrorCode])
);
end;< br />end;
Or the same without type library:
procedure TForm1.Button1Click(Sender: TObject);
var
I: Integer;
JobIDs: OleVariant;
FaxServer: OleVariant;
FaxDocument: OleVariant;
begin
try
FaxServer := CreateOleObject(' FaxComEx.FaxServer');
FaxServer.Connect('');
FaxDocument := CreateOleObject('FaxComEx.FaxDocument');
FaxDocument.Body :='d:\Document.pdf ';
FaxDocument.DocumentName :='Document name';
FaxDocument.Recipients.Add('+1 (425) 555-4567','Bill');
FaxDocument.Sender. Name :='Bob';
FaxDocument.Sender.BillingCode := '23A54';
FaxDocument.Sender.Department: ='Accts Payable';
FaxDocument.Sender.FaxNumber :='+972 (4) 555-9070';
JobIDs := FaxDocument.ConnectedSubmit(FaxServer);
for I := VarArrayLowBound(JobIDs, 1) to VarArrayHighBound(JobIDs, 1) do
ShowMessage('Job ID: '+ VarArrayGet(JobIDs, [I]));
except
on E: EOleSysError do
ShowMessage(
Format('Sending of the fax failed! %s [%d]', [E.Message, E.ErrorCode])
);
end;
end;