mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-17 20:46:17 +02:00

------------------------------------------------------- Addfunction / frFuncStr - Fixed string functions - accounted for UTF8 strings DialogControls - Fixed reports generation with built-in query mode, MDI (multiple reports open for viewing at the same time) - Fixed UNDO in editor - Added property HINT for dialog controls - A new component - TlrRadioGroup lrOfficeImport - New tool reports designer to import data from a spreadsheet as a report template source - The object TfrMemoView added new handlers - OnClick - Event when you click on TfrMemoView in playback mode built reports - OnMouseEnter - Event at the Enter of the mouse over TfrMemoView in playback mode built reports - OnMouseLeave - Event at the Leave of the mouse TfrMemoView in playback mode built reports - The object TfrMemoView added new properties - Cursor - the mouse cursor when moving over TfrMemoView in playback mode built reports - DetailReport - a reference to the detail-report - called when the user clicks the mouse on TfrMemoView in playback mode built reports - A mechanism to detail-report - call a detailed report of the current report - In ineterpretatore added new features (for compatibility with FastReport 2.5): - FINALPASS - CURY - PAGEHEIGH - PAGEWIDTH - In the reports, the editor started saving paramerov editor (the location of the Object Inspector, fonts) - In the reports, the editor corrected the addition of new tools (implemented a new tool - Import report template from excel/OpenOffice) - Editor of reports finalized Inspector data - now you can also insert variables - For export to txt implemented request form export options images - Made in the resources icon tool insert fields in a report from the editor Demo included (detail_reports) And new extensions: - import report template from calc/excel - send email from report preview (for sending used local mail app, installed on user PC - in windows its TheBat! and Mozilla Thunderbird). In future I'm plan make direct send. git-svn-id: trunk@46079 -
70 lines
1.5 KiB
ObjectPascal
70 lines
1.5 KiB
ObjectPascal
unit lrEmailAppMS;
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
interface
|
|
|
|
uses
|
|
Classes, SysUtils, lrEmailExportFilter;
|
|
|
|
type
|
|
{ TEmailAppMSOutlook }
|
|
|
|
TEmailAppMSOutlook = class(TEmailApp)
|
|
protected
|
|
public
|
|
procedure MakeEmail(AFilter:TlrEmailExportFilter);override;
|
|
class function AppName:string;override;
|
|
class function AppValid:boolean;override;
|
|
end;
|
|
|
|
implementation
|
|
uses windows, variants, ComObj, Dialogs;
|
|
|
|
{ TEmailAppMSOutlook }
|
|
|
|
procedure TEmailAppMSOutlook.MakeEmail(AFilter: TlrEmailExportFilter);
|
|
Var
|
|
myItem, myAttachments, myAttachment : Variant;
|
|
const
|
|
olMailItem=0;
|
|
var
|
|
MailItem: Variant;
|
|
Outlook: OLEVariant;
|
|
begin
|
|
try
|
|
//Outlook:=GetActiveOleObject('Outlook.Application');
|
|
Outlook:=CreateOleObject('Outlook.Application');
|
|
MailItem:=Outlook.CreateItem(olMailItem);
|
|
MailItem.Recipients.Add(FFilter.Email); //'Список адресов');
|
|
MailItem.Subject:=FFilter.MessageSubject; //'Заголовок письма';
|
|
MailItem.Body:= FFilter.MessageBody.Text; //'Тело письма';
|
|
myAttachments := MailItem.Attachments;
|
|
myAttachment := myAttachments.Add(FFilter.EmailAttachFileName);
|
|
MailItem.Send;
|
|
Outlook:=Unassigned;
|
|
//Outlook:=Unassigned;
|
|
Except
|
|
ShowMessage('OLE error!');
|
|
End;
|
|
end;
|
|
|
|
class function TEmailAppMSOutlook.AppName: string;
|
|
begin
|
|
Result:='MS Outlook';
|
|
end;
|
|
|
|
class function TEmailAppMSOutlook.AppValid: boolean;
|
|
begin
|
|
{$IFNDEF WINDOWS}
|
|
Result:=false;
|
|
{$ELSE}
|
|
Result:=true;
|
|
{$ENDIF}
|
|
end;
|
|
|
|
initialization
|
|
RegisterEmailApp(TEmailAppMSOutlook);
|
|
end.
|
|
|