GetTexts.xba 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
  3. <!--
  4. * This file is part of the LibreOffice project.
  5. *
  6. * This Source Code Form is subject to the terms of the Mozilla Public
  7. * License, v. 2.0. If a copy of the MPL was not distributed with this
  8. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  9. *
  10. * This file incorporates work covered by the following license notice:
  11. *
  12. * Licensed to the Apache Software Foundation (ASF) under one or more
  13. * contributor license agreements. See the NOTICE file distributed
  14. * with this work for additional information regarding copyright
  15. * ownership. The ASF licenses this file to you under the Apache
  16. * License, Version 2.0 (the "License"); you may not use this file
  17. * except in compliance with the License. You may obtain a copy of
  18. * the License at http://www.apache.org/licenses/LICENSE-2.0 .
  19. -->
  20. <script:module xmlns:script="http://openoffice.org/2000/script" script:name="GetTexts" script:language="StarBasic">Option Explicit
  21. &apos; Description:
  22. &apos; This macro extracts the strings out of the currently active document and inserts them into a log document.
  23. &apos; The aim of the macro is to provide the programmer an insight into the OpenOffice API.
  24. &apos; It focuses on how document objects are accessed.
  25. &apos; Therefore not only texts of the document body are retrieved but also texts of general
  26. &apos; document objects like, annotations, charts and general document information.
  27. Public oLogDocument, oLogText, oLogCursor, oLogHeaderStyle, oLogBodyTextStyle as Object
  28. Public oDocument as Object
  29. Public LogArray(1000) as String
  30. Public LogIndex as Integer
  31. Public oLocHeaderStyle as Object
  32. Sub Main
  33. Dim sDocType as String
  34. Dim oHyperCursor as Object
  35. Dim oCharStyles as Object
  36. BasicLibraries.LoadLibrary(&quot;Tools&quot;)
  37. On Local Error GoTo NODOCUMENT
  38. oDocument = StarDesktop.ActiveFrame.Controller.Model
  39. sDocType = GetDocumentType(oDocument)
  40. NODOCUMENT:
  41. If Err &lt;&gt; 0 Then
  42. Msgbox(&quot;This macro extracts all data from the active Writer, Calc or Draw/Impress document.&quot; &amp; chr(13) &amp;_
  43. &quot;To start this macro you have to activate a document first.&quot; , 16, GetProductName)
  44. Exit Sub
  45. End If
  46. On Local Error Goto 0
  47. &apos; Open a new document where all the texts are inserted
  48. oLogDocument = CreateNewDocument(&quot;swriter&quot;)
  49. If Not IsNull(oLogDocument) Then
  50. oLogText = oLogDocument.Text
  51. &apos; create and define the character styles of the log document
  52. oCharStyles = oLogDocument.StyleFamilies.GetByName(&quot;CharacterStyles&quot;)
  53. oLogHeaderStyle = oLogDocument.createInstance(&quot;com.sun.star.style.CharacterStyle&quot;)
  54. oCharStyles.InsertbyName(&quot;Log Header&quot;, oLogHeaderStyle)
  55. oLogHeaderStyle.charWeight = com.sun.star.awt.FontWeight.BOLD
  56. oLogBodyTextStyle = oLogDocument.createInstance(&quot;com.sun.star.style.CharacterStyle&quot;)
  57. oCharStyles.InsertbyName(&quot;Log Body&quot;, oLogBodyTextStyle)
  58. &apos; Insert the title of the activated document as a hyperlink
  59. oHyperCursor = oLogText.createTextCursor()
  60. oHyperCursor.CharWeight = com.sun.star.awt.FontWeight.BOLD
  61. oHyperCursor.gotoStart(False)
  62. oHyperCursor.HyperLinkURL = oDocument.URL
  63. oHyperCursor.HyperLinkTarget = oDocument.URL
  64. If oDocument.DocumentProperties.Title &lt;&gt; &quot;&quot; Then
  65. oHyperCursor.HyperlinkName = oDocument.DocumentProperties.Title
  66. End If
  67. oLogText.insertString(oHyperCursor, oDocument.DocumentProperties.Title, False)
  68. oLogText.insertControlCharacter(oHyperCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
  69. oLogCursor = oLogText.createTextCursor()
  70. oLogCursor.GotoEnd(False)
  71. &apos; &quot;Switch off&quot; the Hyperlink - Properties
  72. oLogCursor.SetPropertyToDefault(&quot;HyperLinkURL&quot;)
  73. oLogCursor.SetPropertyToDefault(&quot;HyperLinkTarget&quot;)
  74. oLogCursor.SetPropertyToDefault(&quot;HyperLinkName&quot;)
  75. LogIndex = 0
  76. &apos; Get the Properties of the document
  77. GetDocumentProps()
  78. Select Case sDocType
  79. Case &quot;swriter&quot;
  80. GetWriterStrings()
  81. Case &quot;scalc&quot;
  82. GetCalcStrings()
  83. Case &quot;sdraw&quot;, &quot;simpress&quot;
  84. GetDrawStrings()
  85. Case Else
  86. Msgbox(&quot;This macro only works with a Writer, Calc or Draw/Impress document.&quot;, 16, GetProductName())
  87. End Select
  88. End If
  89. End Sub
  90. &apos; ***********************************************Calc documents**************************************************
  91. Sub GetCalcStrings()
  92. Dim i, n as integer
  93. Dim oSheet as Object
  94. Dim SheetName as String
  95. Dim oSheets as Object
  96. &apos; Create a sequence of all sheets within the document
  97. oSheets = oDocument.Sheets
  98. For i = 0 to osheets.Count - 1
  99. oSheet = osheets.GetbyIndex(i)
  100. SheetName = oSheet.Name
  101. MakeLogHeadLine(&quot;Sheet No. &quot; &amp; i &amp; &quot; (&quot; &amp; SheetName &amp; &quot;)&quot; )
  102. &apos; Check the &quot;body&quot; of the sheet
  103. GetCellTexts(oSheet)
  104. If oSheet.IsScenario then
  105. MakeLogHeadLine(&quot;Scenario Comments from &quot; &amp; SheetName &amp; &quot;&apos;&quot;)
  106. WriteStringtoLogFile(osheet.ScenarioComment)
  107. End if
  108. GetAnnotations(oSheet, &quot;Annotations from &apos;&quot; &amp; SheetName &amp; &quot;&apos;&quot;)
  109. GetChartStrings(oSheet, &quot;Charts from &apos;&quot; &amp; SheetName &amp; &quot;&apos;&quot;)
  110. GetControlStrings(oSheet.DrawPage, &quot;Controls from &apos;&quot; &amp; SheetName &amp; &quot;&apos;&quot;)
  111. Next
  112. &apos; Pictures
  113. GetCalcGraphicNames()
  114. GetNamedRanges()
  115. End Sub
  116. Sub GetCellTexts(oSheet as Object)
  117. Dim BigRange, BigEnum, oCell as Object
  118. BigRange = oDocument.CreateInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
  119. BigRange.InsertbyName(&quot;&quot;,oSheet)
  120. BigEnum = BigRange.GetCells.CreateEnumeration
  121. While BigEnum.hasmoreElements
  122. oCell = BigEnum.NextElement
  123. If oCell.String &lt;&gt; &quot;&quot; And Val(oCell.String) = 0then
  124. WriteStringtoLogFile(oCell.String)
  125. End If
  126. Wend
  127. End Sub
  128. Sub GetAnnotations(oSheet as Object, HeaderLine as String)
  129. Dim oNotes as Object
  130. Dim n as Integer
  131. oNotes = oSheet.getAnnotations
  132. If oNotes.hasElements() then
  133. MakeLogHeadLine(HeaderLine)
  134. For n = 0 to oNotes.Count-1
  135. WriteStringtoLogFile(oNotes.GetbyIndex(n).String)
  136. Next
  137. End if
  138. End Sub
  139. Sub GetNamedRanges()
  140. Dim i as integer
  141. MakeLogHeadLine(&quot;Named Ranges&quot;)
  142. For i = 0 To oDocument.NamedRanges.Count - 1
  143. WriteStringtoLogFile(oDocument.NamedRanges.GetbyIndex(i).Name)
  144. Next
  145. End Sub
  146. Sub GetCalcGraphicNames()
  147. Dim n,m as integer
  148. MakeLogHeadLine(&quot;Graphics&quot;)
  149. For n = 0 To oDocument.Drawpages.count-1
  150. For m = 0 To oDocument.Drawpages.GetbyIndex(n).Count - 1
  151. WriteStringtoLogFile(oDocument.DrawPages.GetbyIndex(n).GetbyIndex(m).Text.String)
  152. Next m
  153. Next n
  154. End Sub
  155. &apos; ***********************************************Writer documents**************************************************
  156. Sub GetParagraphTexts(oParaObject as Object, HeadLine as String)
  157. Dim ParaEnum as Object
  158. Dim oPara as Object
  159. Dim oTextPortEnum as Object
  160. Dim oTextPortion as Object
  161. Dim i as integer
  162. Dim oCellNames()
  163. Dim oCell as Object
  164. MakeLogHeadLine(HeadLine)
  165. ParaEnum = oParaObject.Text.CreateEnumeration
  166. While ParaEnum.HasMoreElements
  167. oPara = ParaEnum.NextElement
  168. &apos; Note: The enumeration ParaEnum lists all tables and paragraphs.
  169. &apos; Therefore we have to find out what kind of object &quot;oPara&quot; actually is
  170. If oPara.supportsService(&quot;com.sun.star.text.Paragraph&quot;) Then
  171. &apos; &quot;oPara&quot; is a Paragraph
  172. oTextPortEnum = oPara.createEnumeration
  173. While oTextPortEnum.hasmoreElements
  174. oTextPortion = oTextPortEnum.nextElement()
  175. WriteStringToLogFile(oTextPortion.String)
  176. Wend
  177. Else
  178. &apos; &quot;oPara&quot; is a table
  179. oCellNames = oPara.CellNames
  180. For i = 0 To Ubound(oCellNames())
  181. If oCellNames(i) &lt;&gt; &quot;&quot; Then
  182. oCell = oPara.getCellByName(oCellNames(i))
  183. WriteStringToLogFile(oCell.String)
  184. End If
  185. Next
  186. End If
  187. Wend
  188. End Sub
  189. Sub GetChartStrings(oSheet as Object, HeaderLine as String)
  190. Dim i as Integer
  191. Dim aChartObject as Object
  192. Dim aChartDiagram as Object
  193. MakeLogHeadLine(HeaderLine)
  194. For i = 0 to oSheet.Charts.Count-1
  195. aChartObject = oSheet.Charts.GetByIndex(i).EmbeddedObject
  196. If aChartObject.HasSubTitle then
  197. WriteStringToLogFile(aChartObject.SubTitle.String)
  198. End If
  199. If aChartObject.HasMainTitle then
  200. WriteStringToLogFile(aChartObject.Title.String)
  201. End If
  202. aChartDiagram = aChartObject.Diagram
  203. If aChartDiagram.hasXAxisTitle Then
  204. WriteStringToLogFile(aChartDiagram.XAxisTitle)
  205. End If
  206. If aChartDiagram.hasYAxisTitle Then
  207. WriteStringToLogFile(aChartDiagram.YAxisTitle)
  208. End If
  209. If aChartDiagram.hasZAxisTitle Then
  210. WriteStringToLogFile(aChartDiagram.ZAxisTitle)
  211. End If
  212. Next i
  213. End Sub
  214. Sub GetFrameTexts()
  215. Dim i as integer
  216. Dim oTextFrame as object
  217. Dim oFrameEnum as Object
  218. Dim oFramePort as Object
  219. Dim oFrameTextEnum as Object
  220. Dim oFrameTextPort as Object
  221. MakeLogHeadLine(&quot;Text Frames&quot;)
  222. For i = 0 to oDocument.TextFrames.Count-1
  223. oTextFrame = oDocument.TextFrames.GetbyIndex(i)
  224. WriteStringToLogFile(oTextFrame.Name)
  225. &apos; Is the frame bound to the page?
  226. If oTextFrame.AnchorType = com.sun.star.text.TextContentAnchorType.AT_PAGE Then
  227. GetParagraphTexts(oTextFrame, &quot;Text Frame Contents&quot;)
  228. End If
  229. oFrameEnum = oTextFrame.CreateEnumeration
  230. While oFrameEnum.HasMoreElements
  231. oFramePort = oFrameEnum.NextElement
  232. If oFramePort.supportsService(&quot;com.sun.star.text.Paragraph&quot;) then
  233. oFrameTextEnum = oFramePort.createEnumeration
  234. While oFrameTextEnum.HasMoreElements
  235. oFrameTextPort = oFrameTextEnum.NextElement
  236. If oFrameTextPort.SupportsService(&quot;com.sun.star.text.TextFrame&quot;) Then
  237. WriteStringtoLogFile(oFrameTextPort.String)
  238. End If
  239. Wend
  240. Else
  241. WriteStringtoLogFile(oFramePort.Name)
  242. End if
  243. Wend
  244. Next
  245. End Sub
  246. Sub GetTextFieldStrings()
  247. Dim aTextField as Object
  248. Dim i as integer
  249. Dim CurElement as Object
  250. MakeLogHeadLine(&quot;Text Fields&quot;)
  251. aTextfield = oDocument.getTextfields.CreateEnumeration
  252. While aTextField.hasmoreElements
  253. CurElement = aTextField.NextElement
  254. If CurElement.PropertySetInfo.hasPropertybyName(&quot;Content&quot;) Then
  255. WriteStringtoLogFile(CurElement.Content)
  256. ElseIf CurElement.PropertySetInfo.hasPropertybyName(&quot;PlaceHolder&quot;) Then
  257. WriteStringtoLogFile(CurElement.PlaceHolder)
  258. WriteStringtoLogFile(CurElement.Hint)
  259. ElseIf Curelement.TextFieldMaster.PropertySetInfo.HasPropertybyName(&quot;Content&quot;) then
  260. WriteStringtoLogFile(CurElement.TextFieldMaster.Content)
  261. End If
  262. Wend
  263. End Sub
  264. Sub GetLinkedFileNames()
  265. Dim oDocSections as Object
  266. Dim LinkedFileName as String
  267. Dim i as Integer
  268. If Right(oDocument.URL,3) = &quot;sgl&quot; Then
  269. MakeLogHeadLine(&quot;Sub-documents&quot;)
  270. oDocSections = oDocument.TextSections
  271. For i = 0 to oDocSections.Count - 1
  272. LinkedFileName = oDocSections.GetbyIndex(i).FileLink.FileURL
  273. If LinkedFileName &lt;&gt; &quot;&quot; Then
  274. WriteStringToLogFile(LinkedFileName)
  275. End If
  276. Next i
  277. End If
  278. End Sub
  279. Sub GetSectionNames()
  280. Dim i as integer
  281. Dim oDocSections as Object
  282. MakeLogHeadLine(&quot;Sections&quot;)
  283. oDocSections = oDocument.TextSections
  284. For i = 0 to oDocSections.Count-1
  285. WriteStringtoLogFile(oDocSections.GetbyIndex(i).Name)
  286. Next
  287. End Sub
  288. Sub GetWriterStrings()
  289. GetParagraphTexts(oDocument, &quot;Document Body&quot;)
  290. GetGraphicNames()
  291. GetStyles()
  292. GetControlStrings(oDocument.DrawPage, &quot;Controls&quot;)
  293. GetTextFieldStrings()
  294. GetSectionNames()
  295. GetFrameTexts()
  296. GetHyperLinks
  297. GetLinkedFileNames()
  298. End Sub
  299. &apos; ***********************************************Draw/Impress documents**************************************************
  300. Sub GetDrawPageTitles(LocObject as Object)
  301. Dim n as integer
  302. Dim oPage as Object
  303. For n = 0 to LocObject.Count - 1
  304. oPage = LocObject.GetbyIndex(n)
  305. WriteStringtoLogFile(oPage.Name)
  306. &apos; Is the page a DrawPage and not a MasterPage?
  307. If oPage.supportsService(&quot;com.sun.star.drawing.DrawPage&quot;)then
  308. &apos; Get the name of the NotesPage (only relevant for Impress documents)
  309. If oDocument.supportsService(&quot;com.sun.star.presentation.PresentationDocument&quot;) then
  310. WriteStringtoLogFile(oPage.NotesPage.Name)
  311. End If
  312. End If
  313. Next
  314. End Sub
  315. Sub GetPageStrings(oPages as Object)
  316. Dim m, n, s as Integer
  317. Dim oPage, oPageElement, oShape as Object
  318. For n = 0 to oPages.Count-1
  319. oPage = oPages.GetbyIndex(n)
  320. If oPage.HasElements then
  321. For m = 0 to oPage.Count-1
  322. oPageElement = oPage.GetByIndex(m)
  323. If HasUnoInterfaces(oPageElement,&quot;com.sun.star.container.XIndexAccess&quot;) Then
  324. &apos; The Object &quot;oPageElement&quot; a group of Shapes, that can be accessed by their index
  325. For s = 0 To oPageElement.Count - 1
  326. WriteStringToLogFile(oPageElement.GetByIndex(s).String)
  327. Next s
  328. ElseIf HasUnoInterfaces(oPageElement, &quot;com.sun.star.text.XText&quot;) Then
  329. WriteStringtoLogFile(oPageElement.String)
  330. End If
  331. Next
  332. End If
  333. Next
  334. End Sub
  335. Sub GetDrawStrings()
  336. Dim oDPages, oMPages as Object
  337. oDPages = oDocument.DrawPages
  338. oMPages = oDocument.Masterpages
  339. MakeLogHeadLine(&quot;Titles&quot;)
  340. GetDrawPageTitles(oDPages)
  341. GetDrawPageTitles(oMPages)
  342. MakeLogHeadLine(&quot;Document Body&quot;)
  343. GetPageStrings(oDPages)
  344. GetPageStrings(oMPages)
  345. End Sub
  346. &apos; ***********************************************Misc**************************************************
  347. Sub GetDocumentProps()
  348. Dim oDocuProps as Object
  349. MakeLogHeadLine(&quot;Document Properties&quot;)
  350. oDocuProps = oDocument.DocumentProperties
  351. WriteStringToLogFile(oDocuProps.Title)
  352. WriteStringToLogFile(oDocuProps.Description)
  353. WriteStringToLogFile(oDocuProps.Subject)
  354. WriteStringToLogFile(oDocuProps.Author)
  355. &apos; WriteStringToLogFile(oDocuProps.UserDefinedProperties.ReplyTo)
  356. &apos; WriteStringToLogFile(oDocuProps.UserDefinedProperties.Recipient)
  357. &apos; WriteStringToLogFile(oDocuProps.UserDefinedProperties.References)
  358. &apos; WriteStringToLogFile(oDocuProps.Keywords)
  359. End Sub
  360. Sub GetHyperlinks()
  361. Dim i as integer
  362. Dim oCrsr as Object
  363. Dim oAllHyperLinks as Object
  364. Dim SrchAttributes(0) as new com.sun.star.beans.PropertyValue
  365. Dim oSearchDesc as Object
  366. MakeLogHeadLine(&quot;Hyperlinks&quot;)
  367. &apos; create a Search-Descriptor
  368. oSearchDesc = oDocument.CreateSearchDescriptor
  369. oSearchDesc.Valuesearch = False
  370. &apos; define the Search-attributes
  371. srchattributes(0).Name = &quot;HyperLinkURL&quot;
  372. srchattributes(0).Value = &quot;&quot;
  373. oSearchDesc.SetSearchAttributes(SrchAttributes())
  374. oAllHyperLinks = oDocument.findAll(oSearchDesc())
  375. For i = 0 to oAllHyperLinks.Count - 1
  376. oFound = oAllHyperLinks(i)
  377. oCrsr = oFound.Text.createTextCursorByRange(oFound)
  378. WriteStringToLogFile(oCrs.HyperLinkURL) &apos;Url
  379. WriteStringToLogFile(oCrs.HyperLinkTarget) &apos;Name
  380. WriteStringToLogFile(oCrs.HyperLinkName) &apos;Frame
  381. Next i
  382. End Sub
  383. Sub GetGraphicNames()
  384. Dim i as integer
  385. Dim oDocGraphics as Object
  386. MakeLogHeadLine(&quot;Graphics&quot;)
  387. oDocGraphics = oDocument.GraphicObjects
  388. For i = 0 to oDocGraphics.count - 1
  389. WriteStringtoLogFile(oDocGraphics.GetbyIndex(i).Name)
  390. Next
  391. End Sub
  392. Sub GetStyles()
  393. Dim m,n as integer
  394. MakeLogHeadLine(&quot;User-defined Templates&quot;)
  395. &apos; Check all StyleFamilies(i.e. PageStyles, ParagraphStyles, CharacterStyles, cellStyles)
  396. For n = 0 to oDocument.StyleFamilies.Count - 1
  397. For m = 0 to oDocument.StyleFamilies.getbyIndex(n).Count-1
  398. If oDocument.StyleFamilies.GetbyIndex(n).getbyIndex(m).IsUserDefined then
  399. WriteStringtoLogFile(oDocument.StyleFamilies.GetbyIndex(n).getbyIndex(m).Name)
  400. End If
  401. Next
  402. Next
  403. End Sub
  404. Sub GetControlStrings(oDPage as Object, HeaderLine as String)
  405. Dim aForm as Object
  406. Dim m,n as integer
  407. MakeLogHeadLine(HeaderLine)
  408. &apos;SearchFor all possible Controls
  409. For n = 0 to oDPage.Forms.Count - 1
  410. aForm = oDPage.Forms(n)
  411. For m = 0 to aForm.Count-1
  412. GetControlContent(aForm.GetbyIndex(m))
  413. Next
  414. Next
  415. End Sub
  416. Sub GetControlContent(LocControl as Object)
  417. Dim i as integer
  418. If LocControl.PropertySetInfo.HasPropertybyName(&quot;Label&quot;) then
  419. WriteStringtoLogFile(LocControl.Label)
  420. ElseIf LocControl.SupportsService(&quot;com.sun.star.form.component.ListBox&quot;) then
  421. For i = 0 to Ubound(LocControl.StringItemList())
  422. WriteStringtoLogFile(LocControl.StringItemList(i))
  423. Next
  424. End If
  425. If LocControl.PropertySetInfo.HasPropertybyName(&quot;HelpText&quot;) then
  426. WriteStringtoLogFile(LocControl.Helptext)
  427. End If
  428. End Sub
  429. &apos; ***********************************************Log document**************************************************
  430. Sub WriteStringtoLogFile( sString as String)
  431. If (Not FieldInArray(LogArray(),LogIndex,sString))AND (NOT ISNULL(sString)) Then
  432. LogArray(LogIndex) = sString
  433. LogIndex = LogIndex + 1
  434. oLogText.insertString(oLogCursor,sString,False)
  435. oLogText.insertControlCharacter(oLogCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
  436. End If
  437. End Sub
  438. Sub MakeLogHeadLine(HeadText as String)
  439. oLogCursor.CharStyleName = &quot;Log Header&quot;
  440. oLogText.insertControlCharacter(oLogCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
  441. oLogText.insertString(oLogCursor,HeadText,False)
  442. oLogText.insertControlCharacter(oLogCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
  443. oLogCursor.CharStyleName = &quot;Log Body&quot;
  444. End Sub
  445. </script:module>