<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://wiki-de.moshellshocker.dns64.de/index.php?action=history&amp;feed=atom&amp;title=Wikipedia%3ATechnik%2FText%2FBasic%2FOOo_Calc2Dokuwiki</id>
	<title>Wikipedia:Technik/Text/Basic/OOo Calc2Dokuwiki - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://wiki-de.moshellshocker.dns64.de/index.php?action=history&amp;feed=atom&amp;title=Wikipedia%3ATechnik%2FText%2FBasic%2FOOo_Calc2Dokuwiki"/>
	<link rel="alternate" type="text/html" href="https://wiki-de.moshellshocker.dns64.de/index.php?title=Wikipedia:Technik/Text/Basic/OOo_Calc2Dokuwiki&amp;action=history"/>
	<updated>2026-06-05T19:00:33Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Wikipedia (Deutsch) – Lokale Kopie</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://wiki-de.moshellshocker.dns64.de/index.php?title=Wikipedia:Technik/Text/Basic/OOo_Calc2Dokuwiki&amp;diff=1172595&amp;oldid=prev</id>
		<title>imported&gt;Lómelinde: :Kategorie:Wikipedia:Seite mit Syntaxhervorhebungsfehlern falsche Angabe lang=&quot;freebasic&quot;  siehe auch Hilfe:Syntaxhighlight#Unterstützte Sprachen wurde wohl ersetzt oder geändert zu basic?</title>
		<link rel="alternate" type="text/html" href="https://wiki-de.moshellshocker.dns64.de/index.php?title=Wikipedia:Technik/Text/Basic/OOo_Calc2Dokuwiki&amp;diff=1172595&amp;oldid=prev"/>
		<updated>2023-06-20T15:14:55Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php?title=Kategorie:Wikipedia:Seite_mit_Syntaxhervorhebungsfehlern&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Kategorie:Wikipedia:Seite mit Syntaxhervorhebungsfehlern (Seite nicht vorhanden)&quot;&gt;Kategorie:Wikipedia:Seite mit Syntaxhervorhebungsfehlern&lt;/a&gt; falsche Angabe lang=&amp;quot;freebasic&amp;quot;  siehe auch &lt;a href=&quot;/index.php/Hilfe:Syntaxhighlight#Unterstützte_Sprachen&quot; title=&quot;Hilfe:Syntaxhighlight&quot;&gt;Hilfe:Syntaxhighlight#Unterstützte Sprachen&lt;/a&gt; wurde wohl ersetzt oder geändert zu basic?&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Dieses [[StarOffice]]-Makro &amp;#039;&amp;#039;&amp;#039;Calc2Dokuwiki&amp;#039;&amp;#039;&amp;#039; ([http://www.lucsorel.com/index.php?page=downloads#calc2dokuwiki lucsorel.com]) konvertiert Tabellen der [[OpenOffice]]&amp;lt;!-- welche --&amp;gt;-Tabellenkalkulation in [[MediaWiki]]- oder [[DokuWiki]]-Tabellen. Die Konvertierung von writer-Tabellen ist schon in den writer integriert. Dessen Zweckentfremdung zur Konvertierung von calc-Tabellen funktioniert nur eingeschränkt (über &amp;#039;&amp;#039;Inhalte einfügen&amp;#039;&amp;#039; im rtf-Format). Dieses Makro konvertiert die Tabellen direkt.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
über Extras / Extension Manager / Hinzufügen ...&lt;br /&gt;
&lt;br /&gt;
== Konvertierung ==&lt;br /&gt;
Über das calc-Menü&lt;br /&gt;
 Extras/Makros/Makros Verwalten/OpenOffice.org Basic&lt;br /&gt;
ein neues Makro anlegen. Dort unten stehenden [[#Code|Code]] via Zwischenablage eingefügen.&lt;br /&gt;
&lt;br /&gt;
== Anwendung ==&lt;br /&gt;
Vor dem Makroaufruf die gewünschten Zeilen / Spalten markieren.&lt;br /&gt;
&lt;br /&gt;
Falls nicht alle Zeilen und Spalten benötigt werden, kann vor der Konvertierung eine Filterung erfolgen. Zeilen und Spalten können wie folgt gefiltert werden:&lt;br /&gt;
# Zeilen mit Autofilter filtern.&lt;br /&gt;
# Gefilterte Zeilen markieren, kopieren und mit &amp;#039;&amp;#039;Inhalte einfügen&amp;#039;&amp;#039; (ohne Formeln) in ein anderes Tabellenblatt einfügen. Dort die nicht benötigten Spalten löschen. Anschließend können die verbleibenden Zellen markiert und mit dem Makro konvertiert werden. Die Selektion sollte nur &amp;#039;&amp;#039;genau&amp;#039;&amp;#039; die benötigten Spalten und Zeilen umfassen. Andernfalls entstehen leere Zeilen und Spalten.&lt;br /&gt;
&lt;br /&gt;
== Code ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;basic&amp;quot;&amp;gt;&lt;br /&gt;
REM  *****  Calc2Dokuwiki  *****&lt;br /&gt;
&amp;#039; Calc2Dokuwiki is an extension for OpenOffice.org 2.x which converts&lt;br /&gt;
&amp;#039; a selection of cells (in Calc, the spreadsheet module) into a table&lt;br /&gt;
&amp;#039; in Dokuwiki code. The code of this extension is distributed under&lt;br /&gt;
&amp;#039; the LGPL and the CeCILL licenses.&lt;br /&gt;
&amp;#039; Copyright (C) 2007  Luc Sorel luc.sorel at gmail.com&lt;br /&gt;
&amp;#039; Erweitert von dokuwiki auf mediawiki (C) LoKiLeCh&lt;br /&gt;
&lt;br /&gt;
REM  *****  LGPL  *****&lt;br /&gt;
&amp;#039; This library is free software; you can redistribute it and/or&lt;br /&gt;
&amp;#039; modify it under the terms of the GNU Lesser General Public&lt;br /&gt;
&amp;#039; License as published by the Free Software Foundation; either&lt;br /&gt;
&amp;#039; version 2.1 of the License, or (at your option) any later version.&lt;br /&gt;
&amp;#039;&lt;br /&gt;
&amp;#039; This library is distributed in the hope that it will be useful,&lt;br /&gt;
&amp;#039; but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
&amp;#039; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU&lt;br /&gt;
&amp;#039; Lesser General Public License for more details.&lt;br /&gt;
&amp;#039;&lt;br /&gt;
&amp;#039; You should have received a copy of the GNU Lesser General Public&lt;br /&gt;
&amp;#039; License along with this library; if not, write to the Free Software&lt;br /&gt;
&amp;#039; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA&lt;br /&gt;
&lt;br /&gt;
REM  *****  CeCILL  *****&lt;br /&gt;
&amp;#039; This software is governed by the CeCILL license under French&lt;br /&gt;
&amp;#039; law and abiding by the rules of distribution of free software.&lt;br /&gt;
&amp;#039; You can use, modify and/or redistribute the software under the&lt;br /&gt;
&amp;#039; terms of the CeCILL license as circulated by CEA, CNRS and INRIA&lt;br /&gt;
&amp;#039; at the following URL &amp;quot;http://www.cecill.info&amp;quot;.&lt;br /&gt;
&amp;#039;&lt;br /&gt;
&amp;#039; As a counterpart to the access to the source code and rights&lt;br /&gt;
&amp;#039; to copy, modify and redistribute granted by the license, users&lt;br /&gt;
&amp;#039; are provided only with a limited warranty and the software&amp;#039;s author,&lt;br /&gt;
&amp;#039; the holder of the economic rights, and the successive licensors have&lt;br /&gt;
&amp;#039; only limited liability.&lt;br /&gt;
&amp;#039;&lt;br /&gt;
&amp;#039; In this respect, the user&amp;#039;s attention is drawn to the risks&lt;br /&gt;
&amp;#039; associated with loading, using, modifying and/or developing&lt;br /&gt;
&amp;#039; or reproducing the software by the user in light of its specific&lt;br /&gt;
&amp;#039; status of free software, that may mean that it is complicated&lt;br /&gt;
&amp;#039; to manipulate, and that also therefore means that it is reserved&lt;br /&gt;
&amp;#039; for developers and experienced professionals having in-depth&lt;br /&gt;
&amp;#039; computer knowledge. Users are therefore encouraged to load and&lt;br /&gt;
&amp;#039; test the software&amp;#039;s suitability as regards their requirements in&lt;br /&gt;
&amp;#039; conditions enabling the security of their systems and/or data&lt;br /&gt;
&amp;#039; to be ensured and, more generally, to use and operate it in&lt;br /&gt;
&amp;#039; the same conditions as regards security.&lt;br /&gt;
&amp;#039;&lt;br /&gt;
&amp;#039; The fact that you are presently reading this means that you have&lt;br /&gt;
&amp;#039; had knowledge of the CeCILL license and that you accept its terms.&lt;br /&gt;
&lt;br /&gt;
option explicit&lt;br /&gt;
&lt;br /&gt;
dim mode as string&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
function CellStringNFormat(myCell as object) as string&lt;br /&gt;
  dim myStrg, myBoldStyle as string&lt;br /&gt;
  dim delim as string&lt;br /&gt;
  myStrg = myCell.String&lt;br /&gt;
  &amp;#039; If the cell is empty, returns a [space] otherwise Dokuwiki will merges cells in the row&lt;br /&gt;
  if mode = &amp;quot;m&amp;quot; then&lt;br /&gt;
   delim = &amp;quot;|| &amp;quot;&lt;br /&gt;
  else&lt;br /&gt;
   delim = &amp;quot;| &amp;quot;&lt;br /&gt;
  endif&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
  if (len(myStrg) = 0) then&lt;br /&gt;
    CellStringNFormat = delim&lt;br /&gt;
    exit function&lt;br /&gt;
  endif&lt;br /&gt;
  &amp;#039; Add text format (bold, italic), underline type (true or false), and horisontal alignment (left, center, right)&lt;br /&gt;
  if ((myCell.charWeight = com.sun.star.awt.FontWeight.BOLD) or (myCell.charWeight = com.sun.star.awt.FontWeight.ULTRABOLD)) then myStrg = &amp;quot;**&amp;quot; &amp;amp; myStrg &amp;amp; &amp;quot;**&amp;quot;&lt;br /&gt;
  if (myCell.charPosture = com.sun.star.awt.FontSlant.ITALIC) then myStrg = &amp;quot;//&amp;quot; &amp;amp; myStrg &amp;amp; &amp;quot;//&amp;quot;&lt;br /&gt;
  if not(myCell.CharUnderline = com.sun.star.awt.FontUnderline.NONE) then myStrg = &amp;quot;__&amp;quot; &amp;amp; myStrg &amp;amp; &amp;quot;__&amp;quot;&lt;br /&gt;
  if (myCell.HoriJustify = com.sun.star.table.CellHoriJustify.RIGHT) then myStrg = &amp;quot;  &amp;quot; &amp;amp; myStrg&lt;br /&gt;
  if (myCell.HoriJustify = com.sun.star.table.CellHoriJustify.CENTER) then myStrg = &amp;quot;  &amp;quot; &amp;amp; myStrg &amp;amp; &amp;quot;  &amp;quot;&lt;br /&gt;
  if (myCell.HoriJustify = com.sun.star.table.CellHoriJustify.LEFT) then myStrg = myStrg &amp;amp; &amp;quot;  &amp;quot;&lt;br /&gt;
  if (myCell.HoriJustify = com.sun.star.table.CellHoriJustify.STANDARD) then myStrg = &amp;quot;  &amp;quot; &amp;amp; myStrg&lt;br /&gt;
  &amp;#039; Add cell style (heading or standard)&lt;br /&gt;
&lt;br /&gt;
  if mode = &amp;quot;d&amp;quot; then&lt;br /&gt;
   if (InStr(myCell.CellStyle,&amp;quot;heading&amp;quot;)&amp;gt;0) then&lt;br /&gt;
     myStrg = &amp;quot;^&amp;quot; &amp;amp; myStrg&lt;br /&gt;
   else&lt;br /&gt;
     myStrg = delim &amp;amp; myStrg&lt;br /&gt;
   end if&lt;br /&gt;
  else&lt;br /&gt;
   if (InStr(myCell.CellStyle,&amp;quot;heading&amp;quot;)&amp;gt;0) then&lt;br /&gt;
     myStrg = &amp;quot;!&amp;quot; &amp;amp; myStrg&lt;br /&gt;
   else&lt;br /&gt;
     myStrg = delim &amp;amp; myStrg&lt;br /&gt;
   end if&lt;br /&gt;
  endif&lt;br /&gt;
&lt;br /&gt;
  &amp;#039; Return Dokuwiki code for the cell&lt;br /&gt;
  CellStringNFormat = myStrg&lt;br /&gt;
end function&lt;br /&gt;
&lt;br /&gt;
sub writeTableCode(myZone as object, myWriterDocText as object, textCursor as object, optional idSel as integer)&lt;br /&gt;
  dim coordZone as object&lt;br /&gt;
  dim rowMax, colMax, idCol, idRow as integer&lt;br /&gt;
  dim myCellString as string&lt;br /&gt;
  dim endParagraph as integer&lt;br /&gt;
&lt;br /&gt;
  endParagraph = com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK&lt;br /&gt;
  coordZone = myZone.RangeAddress&lt;br /&gt;
  colMax = coordZone.EndColumn-coordZone.StartColumn&lt;br /&gt;
  rowMax = coordZone.EndRow-coordZone.StartRow&lt;br /&gt;
&lt;br /&gt;
  if (IsMissing(idSel)) then&lt;br /&gt;
    myWriterDocText.insertString(textCursor,&amp;quot;Table&amp;quot;, false)&lt;br /&gt;
  else&lt;br /&gt;
    myWriterDocText.insertString(textCursor,&amp;quot;Table &amp;quot; &amp;amp; (idSel+1), false)&lt;br /&gt;
  end if&lt;br /&gt;
  myWriterDocText.insertControlCharacter(textCursor,endParagraph,false)&lt;br /&gt;
&lt;br /&gt;
  if mode = &amp;quot;m&amp;quot; then&lt;br /&gt;
     myWriterDocText.insertString(textCursor, &amp;quot;{|  class=&amp;quot; &amp;amp; chr(34) &amp;amp; &amp;quot;wikitable sortable&amp;quot; &amp;amp; chr(34), false)&lt;br /&gt;
     myWriterDocText.insertControlCharacter(textCursor, endParagraph, false)&lt;br /&gt;
 endif&lt;br /&gt;
&lt;br /&gt;
  for idRow = 0 to rowMax&lt;br /&gt;
    for idCol = 0 to colMax&lt;br /&gt;
      myCellString = CellStringNFormat(myZone.getCellByPosition(idCol,idRow))&lt;br /&gt;
      if idCol = 0 and mode = &amp;quot;m&amp;quot; then myCellString = right(myCellString,len(myCellString)-1)&lt;br /&gt;
      myWriterDocText.insertString(textCursor, myCellString,false)&lt;br /&gt;
    next idCol&lt;br /&gt;
&lt;br /&gt;
   if mode = &amp;quot;m&amp;quot; then&lt;br /&gt;
&lt;br /&gt;
   else&lt;br /&gt;
     myWriterDocText.insertString(textCursor, &amp;quot;|&amp;quot;, false)&lt;br /&gt;
    endif&lt;br /&gt;
&lt;br /&gt;
    myWriterDocText.insertControlCharacter(textCursor, endParagraph, false)&lt;br /&gt;
&lt;br /&gt;
 if mode = &amp;quot;m&amp;quot; then&lt;br /&gt;
     myWriterDocText.insertString(textCursor, &amp;quot;|-&amp;quot;, false)&lt;br /&gt;
     myWriterDocText.insertControlCharacter(textCursor, endParagraph, false)&lt;br /&gt;
 endif&lt;br /&gt;
  next idRow&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   if mode = &amp;quot;m&amp;quot; then&lt;br /&gt;
     myWriterDocText.insertString(textCursor, &amp;quot;|}&amp;quot;, false)&lt;br /&gt;
     myWriterDocText.insertControlCharacter(textCursor, endParagraph, false)&lt;br /&gt;
 endif&lt;br /&gt;
&lt;br /&gt;
  myWriterDocText.insertControlCharacter(textCursor, endParagraph, false)&lt;br /&gt;
end sub&lt;br /&gt;
&lt;br /&gt;
function doesDisplayHelp(myCalcDoc as object) as boolean&lt;br /&gt;
  dim myZone, coordZone as object&lt;br /&gt;
  dim rowMax, colMax as integer&lt;br /&gt;
  dim cellString as string&lt;br /&gt;
&lt;br /&gt;
  myZone = myCalcDoc.CurrentSelection&lt;br /&gt;
  if myZone.supportsService(&amp;quot;com.sun.star.sheet.SheetCellRanges&amp;quot;) then&lt;br /&gt;
    &amp;#039; It&amp;#039;s a multiple selection -&amp;gt; do not display help information&lt;br /&gt;
    doesDisplayHelp = false&lt;br /&gt;
    exit function&lt;br /&gt;
  else&lt;br /&gt;
    &amp;#039; Single selection&lt;br /&gt;
    coordZone = myZone.RangeAddress&lt;br /&gt;
    colMax = coordZone.EndColumn-coordZone.StartColumn&lt;br /&gt;
    rowMax = coordZone.EndRow-coordZone.StartRow&lt;br /&gt;
    if ((colMax &amp;gt; 0) or (rowMax &amp;gt; 0)) then&lt;br /&gt;
      doesDisplayHelp = false&lt;br /&gt;
      exit function&lt;br /&gt;
    else&lt;br /&gt;
      cellString = LCase(myZone.getCellByPosition(0, 0).String)&lt;br /&gt;
      if (cellString = &amp;quot;help&amp;quot;) then&lt;br /&gt;
        doesDisplayHelp = true&lt;br /&gt;
        exit function&lt;br /&gt;
      else&lt;br /&gt;
        doesDisplayHelp = false&lt;br /&gt;
        exit function&lt;br /&gt;
      endif&lt;br /&gt;
    endif&lt;br /&gt;
  endif&lt;br /&gt;
  doesDisplayHelp = false&lt;br /&gt;
end function&lt;br /&gt;
&lt;br /&gt;
Sub Calc2Dokuwiki_Main&lt;br /&gt;
  dim myCalcDoc as Object&lt;br /&gt;
  dim rowMax, colMax, idCol, idRow, idSel as integer&lt;br /&gt;
  dim myCellString as string&lt;br /&gt;
  dim propFichier()&lt;br /&gt;
  dim myWriterDoc, myWriterDocText, textCursor as object&lt;br /&gt;
  dim endParagraph as integer&lt;br /&gt;
  dim helpString as string&lt;br /&gt;
  mode = inputbox(&amp;quot;Bitte geben Sie den gewünschten Dokumententyp an! m für mediawiki d für dokuwiki&amp;quot;,&amp;quot;Dokumententyp definieren&amp;quot;, &amp;quot;m&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
  endParagraph = com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK&lt;br /&gt;
  myCalcDoc = ThisComponent&lt;br /&gt;
&lt;br /&gt;
  if doesDisplayHelp(myCalcDoc) then&lt;br /&gt;
    &amp;#039; Display help information if desired (= one cell selection with word &amp;#039;help&amp;#039; typed in it, without the quote)&lt;br /&gt;
    helpString = &amp;quot;Calc2Dokuwiki converts a selection of cells into a table in Dokuwiki code. The code is generated in a new Writer document ready to be copy-pasted in your Dokuwiki website!&amp;quot;&lt;br /&gt;
    helpString = helpString + Chr(13) + Chr(13) + &amp;quot;A multiple selection of cells ouputs as many tables (in the same Writer document) as selections.&amp;quot;&lt;br /&gt;
    msgBox(helpString,0,&amp;quot;Calc2Dokuwiki - help&amp;quot;)&lt;br /&gt;
  else&lt;br /&gt;
    myWriterDoc = StarDesktop.LoadComponentFromURL(&amp;quot;private:factory/swriter&amp;quot;,&amp;quot;_blank&amp;quot;,0,propFichier)&lt;br /&gt;
    myWriterDocText = myWriterDoc.Text&lt;br /&gt;
    textCursor = myWriterDocText.createTextCursor()&lt;br /&gt;
&lt;br /&gt;
    &amp;#039; Add help access information at the beginning of the document&lt;br /&gt;
    myWriterDocText.insertString(textCursor, &amp;quot;HELP: To read a short user guide about Calc2Dokuwiki extension, type &amp;#039;help&amp;#039; (without the quotes) in a Calc cell, select this cell, and press the extension button again.&amp;quot;, false)&lt;br /&gt;
    myWriterDocText.insertControlCharacter(textCursor, endParagraph, false)&lt;br /&gt;
    myWriterDocText.insertControlCharacter(textCursor, endParagraph, false)&lt;br /&gt;
&lt;br /&gt;
    &amp;#039; Parse the Calc selected cells and produce Dokuwiki code&lt;br /&gt;
    if myCalcDoc.CurrentSelection.supportsService(&amp;quot;com.sun.star.sheet.SheetCellRanges&amp;quot;) then&lt;br /&gt;
      for idSel = 0 to (myCalcDoc.CurrentSelection.count - 1)&lt;br /&gt;
        writeTableCode(myCalcDoc.CurrentSelection(idSel), myWriterDocText, textCursor, idSel)&lt;br /&gt;
      next idSel&lt;br /&gt;
    else&lt;br /&gt;
      writeTableCode(myCalcDoc.CurrentSelection, myWriterDocText, textCursor)&lt;br /&gt;
    endif&lt;br /&gt;
  end if&lt;br /&gt;
&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Kategorie:Wikipedia:Technik/Text|Calc2Dokuwiki]]&lt;/div&gt;</summary>
		<author><name>imported&gt;Lómelinde</name></author>
	</entry>
</feed>