ooInit | Подключение к серверу автоматизации OO |
ooClose | Отключение от сервера автоматизации OO |
ooCloseDoc | Закрытие документа |
ooSaveDoc | Сохранение документа |
ooStartDoc | Переход в начало документа (начало таблицы, начало ячейки таблицы) |
ooEndDoc | Переход в конец документа (конец таблицы, конец ячейки таблицы) |
ooGoToHeadline | Переключение между верхним колонтитулом и основным текстом |
ooGoToBottomHeadline | Переключение между нижним колонтитулом и основным текстом |
ooPrintString | Печать строки символов |
ooEnter | Переход на новую строку (нажатие клавиши Enter) |
ooStartString | Переход в начало строки |
ooEndString | Переход в конец строки |
ooCopy | Копирование в буфер обмена |
ooPaste | Вставка из буфера обмена |
ooSelectAll | Выделить все |
ooSearch | Поиск текста |
ooBreakPage | Вставка разрыва страницы |
ooInsertSymbol | Вставка символа |
ooInsertImage | Вставка изображения |
ooImageToChar | Привязка изображения как символ |
ooRazmerShrift | Изменение кегля |
ooBold | Выделение (снятие выделения) текста жирным шрифтом |
ooItalic | Выделение текста курсивом |
ooUnderline | Выделение текста подчеркиванием |
ooLeftPara | Выравнивание текста по левому краю |
ooCenterPara | Выравнивание текста по центру |
ooRightPara | Выравнивание текста по правому краю |
ooCellColor | Выделение текста светло-серым цветом |
ooCellNoColor | Снятие цветового выделения |
procedure
TOpenOffice.ooInit(dotname:string); var sb:string; begin //если шаблон пустой, то документ создается с чистого бланка if dotname='' then sb:='private:factory/swriter' else sb:='file:///'+dotname; StarOffice:=CreateOleObject('com.sun.star.ServiceManager'); StarDesktop:=StarOffice.CreateInstance('com.sun.star.frame.Desktop'); Document:=StarDesktop.LoadComponentFromURL(sb,'_blank',0,VarArrayCreate([0,-1],varVariant)); end; |
procedure
TOpenOffice.ooClose; begin StarOffice:=Unassigned; end; |
procedure
TOpenOffice.ooCloseDoc; begin Document.close(true); end; |
procedure
TOpenOffice.ooSaveDoc(way:string); var oDispatcher,oArgs:variant; CoreReflection,propertyValue0,propertyValue1,propertyValue2:variant; oFrame:variant; begin way:=StringReplace(way,'\','/',[rfReplaceAll]); oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue2); oArgs:=VarArrayCreate([0,2],varVariant); propertyValue0.Name:='URL'; propertyValue0.Value:='file:///'+way; oArgs[0]:=propertyValue0; propertyValue1.Name:='FilterName'; propertyValue1.Value:='MS Word 97'; oArgs[1]:=propertyValue1; propertyValue2.Name:='SelectionOnly'; propertyValue2.Value:=True; oArgs[2]:=propertyValue2; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:SaveAs','',0,oArgs); end; |
procedure
TOpenOffice.ooStartDoc(col:integer); var oDispatcher,oArray:variant; CoreReflection,propertyValue0:variant; oFrame:variant; i:integer; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); oArray:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:=''; propertyValue0.Value:=0; oArray[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; for I:=1 to col do oDispatcher.executeDispatch(oFrame,'.uno:GoToStartOfDoc','',0,oArray); end; |
procedure
TOpenOffice.ooEndDoc(col: Integer); var oDispatcher,oArray:variant; CoreReflection,propertyValue0:variant; oFrame:variant; i:integer; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); oArray:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:=''; propertyValue0.Value:=0; oArray[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; for I:=1 to col do oDispatcher.executeDispatch(oFrame,'.uno:GoToEndOfDoc','',0,oArray); end; |
procedure
TOpenOffice.ooGoToHeadline; var oDispatcher,oArgs:variant; CoreReflection,propertyValue0,propertyValue1,propertyValue2:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); oArgs:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:=''; propertyValue0.Value:=0; oArgs[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:JumpToHeader','',0,oArgs); end; |
procedure
TOpenOffice.ooGoToBottomHeadline; var oDispatcher,oArgs:variant; CoreReflection,propertyValue0,propertyValue1,propertyValue2:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); oArgs:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:=''; propertyValue0.Value:=0; oArgs[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:JumpToFooter','',0,oArgs); end; |
procedure
TOpenOffice.ooPrintString(sb:string); var oDispatcher,oArgs,oArray:variant; CoreReflection,propertyValue0,propertyValue1:variant; oFrame:variant; begin oArray:=0; oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); oArgs:=VarArrayCreate([0,0],varVariant); oArray:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:='Text'; propertyValue0.Value:=sb; oArgs[0]:=propertyValue0; propertyValue1.Name:=''; propertyValue1.Value:=0; oArray[0]:=propertyValue1; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:InsertText','',0,oArgs); end; |
procedure
TOpenOffice.ooEnter; var oDispatcher,oArray:variant; CoreReflection,propertyValue0:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); oArray:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:=''; propertyValue0.Value:=0; oArray[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:InsertPara','',0,oArray); end; |
procedure
TOpenOffice.ooStartString; var oDispatcher,oArray:variant; CoreReflection,propertyValue0:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); oArray:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:=''; propertyValue0.Value:=0; oArray[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:GoToStartOfLine','',0,oArray); end; |
procedure
TOpenOffice.ooEndString; var oDispatcher,oArray:variant; CoreReflection,propertyValue0:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); oArray:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:=''; propertyValue0.Value:=0; oArray[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:GoToEndOfLine','',0,oArray); end; |
procedure
TOpenOffice.ooCopy; var oDispatcher,oArray:variant; CoreReflection,propertyValue0:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); oArray:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:=''; propertyValue0.Value:=0; oArray[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:Copy','',0,oArray); end; |
procedure
TOpenOffice.ooPaste; var oDispatcher,oArray:variant; CoreReflection,propertyValue0:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); oArray:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:=''; propertyValue0.Value:=0; oArray[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:Paste','',0,oArray); end; |
procedure
TOpenOffice.ooSelectAll; var oDispatcher,oArray:variant; CoreReflection,propertyValue0:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); oArray:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:=''; propertyValue0.Value:=0; oArray[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:SelectAll','',0,oArray); end; |
procedure
TOpenOffice.ooSearch(sb:string); var oDispatcher,oArgs:variant; CoreReflection:variant; propertyValue0,propertyValue1,propertyValue2,propertyValue3:variant; propertyValue4,propertyValue5,propertyValue6,propertyValue7:variant; propertyValue8,propertyValue9,propertyValue10,propertyValue11:variant; propertyValue12,propertyValue13,propertyValue14,propertyValue15:variant; propertyValue16,propertyValue17,propertyValue18:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue2); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue3); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue4); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue5); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue6); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue7); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue8); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue9); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue10); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue11); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue12); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue13); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue14); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue15); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue16); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue17); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue18); oArgs:=VarArrayCreate([0,18],varVariant); propertyValue0.Name:='SearchItem.StyleFamily'; propertyValue0.Value:=2; oArgs[0]:=propertyValue0; propertyValue1.Name:='SearchItem.CellType'; propertyValue1.Value:=0; oArgs[1]:=propertyValue1; propertyValue2.Name:='SearchItem.RowDirection'; propertyValue2.Value:=True; oArgs[2]:=propertyValue2; propertyValue3.Name:='SearchItem.AllTables'; propertyValue3.Value:=False; oArgs[3]:=propertyValue3; propertyValue4.Name:='SearchItem.Backward'; propertyValue4.Value:=False; oArgs[4]:=propertyValue4; propertyValue5.Name:='SearchItem.Pattern'; propertyValue5.Value:=False; oArgs[5]:=propertyValue5; propertyValue6.Name:='SearchItem.Content'; propertyValue6.Value:=False; oArgs[6]:=propertyValue6; propertyValue7.Name:='SearchItem.AsianOptions'; propertyValue7.Value:=False; oArgs[7]:=propertyValue7; propertyValue8.Name:='SearchItem.AlgorithmType'; propertyValue8.Value:=0; oArgs[8]:=propertyValue8; propertyValue9.Name:='SearchItem.SearchFlags'; propertyValue9.Value:=65536; oArgs[9]:=propertyValue9; propertyValue10.Name:='SearchItem.SearchString'; propertyValue10.Value:=sb; oArgs[10]:=propertyValue10; propertyValue11.Name:='SearchItem.ReplaceString'; propertyValue11.Value:=''; oArgs[11]:=propertyValue11; propertyValue12.Name:='SearchItem.Locale'; propertyValue12.Value:=255; oArgs[12]:=propertyValue12; propertyValue13.Name:='SearchItem.ChangedChars'; propertyValue13.Value:=2; oArgs[13]:=propertyValue13; propertyValue14.Name:='SearchItem.DeletedChars'; propertyValue14.Value:=2; oArgs[14]:=propertyValue14; propertyValue15.Name:='SearchItem.InsertedChars'; propertyValue15.Value:=2; oArgs[15]:=propertyValue15; propertyValue16.Name:='SearchItem.TransliterateFlags'; propertyValue16.Value:=1280; oArgs[16]:=propertyValue16; propertyValue17.Name:='SearchItem.Command'; propertyValue17.Value:=0; oArgs[17]:=propertyValue17; propertyValue18.Name:='Quiet'; propertyValue18.Value:=True; oArgs[18]:=propertyValue18; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:ExecuteSearch','',0,oArgs); end; |
procedure
TOpenOffice.ooBreakPage; var oDispatcher,oArgs:variant; CoreReflection,propertyValue0, propertyValue1,propertyValue2:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue2); oArgs:=VarArrayCreate([0,2],varVariant); propertyValue0.Name:='Kind'; propertyValue0.Value:=3; oArgs[0]:=propertyValue0; propertyValue1.Name:='TemplateName'; propertyValue1.Value:=''; oArgs[1]:=propertyValue1; propertyValue2.Name:='PageNumber'; propertyValue2.Value:=0; oArgs[2]:=propertyValue2; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:InsertBreak','',0,oArgs); end; |
procedure
TOpenOffice.ooInsertSymbol(symbol:string); var oDispatcher,oArgs:variant; CoreReflection,propertyValue0,propertyValue1:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); oArgs:=VarArrayCreate([0,1],varVariant); propertyValue0.Name:='Symbols'; propertyValue0.Value:=symbol; oArgs[0]:=propertyValue0; propertyValue1.Name:='FontName'; propertyValue1.Value:='Arial'; oArgs[1]:=propertyValue1; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:InsertSymbol','',0,oArgs); end; |
procedure
TOpenOffice.ooInsertImage(way:string); var oDispatcher,oArgs,oArray,oArray1:variant; CoreReflection,propertyValue0, propertyValue1,propertyValue2,propertyValue3,propertyValue4,propertyValue5:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue2); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue3); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue4); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue5); oArgs:=VarArrayCreate([0,3],varVariant); propertyValue0.Name:='FileName'; propertyValue0.Value:=way; oArgs[0]:=propertyValue0; propertyValue1.Name:='FilterName'; propertyValue1.Value:='<Все форматы>'; oArgs[1]:=propertyValue1; propertyValue2.Name:='AsLink'; propertyValue2.Value:=false; oArgs[2]:=propertyValue2; propertyValue3.Name:='Style'; propertyValue3.Value:='Графика'; oArgs[3]:=propertyValue3; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:InsertGraphic','',0,oArgs); oArray:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:=''; propertyValue0.Value:=0; oArray[0]:=propertyValue4; oDispatcher.executeDispatch(oFrame,'.uno:Escape','',0,oArray); end; |
procedure
TOpenOffice.ooImageToChar; var oDispatcher,oArray:variant; CoreReflection,propertyValue0:variant; oFrame:variant; i:integer; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); oArray:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:=''; propertyValue0.Value:=0; oArray[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:SetAnchorToChar','',0,oArray); end; |
procedure
TOpenOffice.ooRazmerShrift(razm:integer); var oDispatcher,oArgs:variant; CoreReflection,propertyValue0,propertyValue1,propertyValue2:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue2); oArgs:=VarArrayCreate([0,2],varVariant); propertyValue0.Name:='FontHeight.Height'; propertyValue0.Value:=razm; oArgs[0]:=propertyValue0; propertyValue1.Name:='FontHeight.Prop'; propertyValue1.Value:=100; oArgs[1]:=propertyValue1; propertyValue2.Name:='FontHeight.Diff'; propertyValue2.Value:=0; oArgs[2]:=propertyValue2; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:FontHeight','',0,oArgs); end; |
procedure
TOpenOffice.ooBold(Flag:boolean); var oDispatcher,oArgs:variant; CoreReflection,propertyValue0,propertyValue1,propertyValue2:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); oArgs:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:='Bold'; if flag then propertyValue0.Value:=True else propertyValue0.Value:=False; oArgs[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:Bold','',0,oArgs); end; |
procedure
TOpenOffice.ooItalic(Flag:Boolean); var oDispatcher,oArgs:variant; CoreReflection,propertyValue0, propertyValue1,propertyValue2:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); oArgs:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:='Italic'; if flag then propertyValue0.Value:=True else propertyValue0.Value:=False; oArgs[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:Italic','',0,oArgs); end; |
procedure
TOpenOffice.ooUnderline(flag:Integer); var oDispatcher,oArgs:variant; CoreReflection,propertyValue0, propertyValue1,propertyValue2:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue2); oArgs:=VarArrayCreate([0,2],varVariant); propertyValue0.Name:='Underline.Underline'; propertyValue0.Value:=flag; oArgs[0]:=propertyValue0; propertyValue1.Name:='Underline.HasColor'; propertyValue1.Value:=False; oArgs[1]:=propertyValue1; propertyValue2.Name:='Underline.Color'; propertyValue2.Value:=-1; oArgs[2]:=propertyValue2; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:Underline','',0,oArgs); end; |
procedure
TOpenOffice.ooLeftPara; var oDispatcher,oArgs:variant; CoreReflection,propertyValue0,propertyValue1,propertyValue2:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); oArgs:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:='LeftPara'; propertyValue0.Value:=True ; oArgs[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:LeftPara','',0,oArgs); end; |
procedure
TOpenOffice.ooCenterPara; var oDispatcher,oArgs:variant; CoreReflection,propertyValue0:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); oArgs:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:='CenterPara'; propertyValue0.Value:=True; oArgs[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:CenterPara','',0,oArgs); end; |
procedure
TOpenOffice.ooRightPara; var oDispatcher,oArgs:variant; CoreReflection,propertyValue0,propertyValue1,propertyValue2:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); oArgs:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:='RightPara'; propertyValue0.Value:=True ; oArgs[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:RightPara','',0,oArgs); end; |
procedure
TOpenOffice.ooCellColor; var oDispatcher,oArgs:variant; CoreReflection,propertyValue0, propertyValue1,propertyValue2,propertyValue3,propertyValue4:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue1); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue2); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue3); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue4); oArgs:=VarArrayCreate([0,4],varVariant); propertyValue0.Name:='BackgroundPattern.Transparent'; propertyValue0.Value:=false; oArgs[0]:=propertyValue0; propertyValue1.Name:='BackgroundPattern.BackColor'; propertyValue1.Value:=13421772; oArgs[1]:=propertyValue1; propertyValue2.Name:='BackgroundPattern.URL'; propertyValue2.Value:=''; oArgs[2]:=propertyValue2; propertyValue3.Name:='BackgroundPattern.Filtername'; propertyValue3.Value:=''; oArgs[3]:=propertyValue3; propertyValue4.Name:='BackgroundPattern.Position'; propertyValue4.Value:=staroffice.createInstance('com.sun.star.style.GraphicLocation.NONE'); oArgs[4]:=propertyValue4; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:BackgroundPattern','',0,oArgs); end; |
procedure
TOpenOffice.ooCellNoColor; var oDispatcher,oArgs:variant; CoreReflection,propertyValue0:variant; oFrame:variant; begin oDispatcher:=StarOffice.createInstance('com.sun.star.frame.DispatchHelper'); CoreReflection:=StarOffice.createInstance('com.sun.star.reflection.CoreReflection'); CoreReflection.forName('com.sun.star.beans.PropertyValue').createObject(propertyValue0); oArgs:=VarArrayCreate([0,0],varVariant); propertyValue0.Name:='BackgroundColor'; propertyValue0.Value:=-1; oArgs[0]:=propertyValue0; oFrame:=Document.getCurrentController.getFrame; oDispatcher.executeDispatch(oFrame,'.uno:BackgroundColor','',0,oArgs); end; |