1 message in org.openoffice.fr.prog[prog] Calc et Delphi
FromSent OnAttachments
Greborio RobertDec 13, 2005 7:44 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[prog] Calc et DelphiActions...
From:Greborio Robert (greb@eurofasteners.com)
Date:Dec 13, 2005 7:44:29 am
List:org.openoffice.fr.prog

Ci-dessous une UNIt qui pourrait-être utile!

Robert Greborio

unit OpenOffice; interface

procedure StartOffice; Function PathToURL(s:String):String; procedure WriteCell(MyDoc:Variant;CellPos,Text:ShortString); procedure WriteFooter(MyDoc:Variant;Text:ShortString); Function RunMacro:Variant;

implementation Uses OOoTools,OpenOffConst;

procedure StartOffice; Begin ConnectOpenOffice; End;

Function PathToURL(s:String):String; Begin Result:=ConvertToURL(s); End;

procedure WriteCell(MyDoc:Variant;CellPos,Text:ShortString); var Sheets, Sheet, Cell: Variant; begin Sheets:= MyDoc.Sheets; Sheet:= Sheets.getByIndex(0); Cell:= Sheet.getCellRangeByName(CellPos); Cell.String:=Text; end;

procedure WriteFooter(MyDoc:Variant;Text:ShortString); var Sheets,Sheet,StyleFam,PageStyle,HCont,HText: Variant; begin Sheets:=MyDoc; Sheet:=Sheets.CurrentController.getActiveSheet; StyleFam:= Sheets.StyleFamilies.getByName('PageStyles').getByName(Sheet.PageStyle); StyleFam.FooterIsOn:=True; StyleFam.FooterShared:=True; HCont:=StyleFam.RightPageFooterContent; HText:=HCont.CenterText; HText.setString('Screws@2000 Report by GSE Sas'); StyleFam.RightPageFooterContent:=HCont; end;

Function RunMacro:Variant; Begin Result:=CreateProperties(['MacroExecutionMode',_documentMacroExecModeALWAYS_EXECUTE_NO_WARN]); End;

end.