<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Morvan</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Morvan"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Morvan"/>
	<updated>2026-05-17T01:55:02Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:Documentation&amp;diff=214672</id>
		<title>Talk:Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:Documentation&amp;diff=214672"/>
		<updated>2013-02-04T11:34:56Z</updated>

		<summary type="html">&lt;p&gt;Morvan: /* To get Sheet Number Instead of Page Number */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are things listed in the &amp;quot;documentation&amp;quot; box on the frontpage that are missing here (for example: [[OOoHelpOutline]], [[Documentation/Dashboard/Application_Online_Help]]).&lt;br /&gt;
So these are either:&lt;br /&gt;
* outdated/obsolete and should be removed from the frontpage&lt;br /&gt;
* not outdated/obsolete and should be linked from here&lt;br /&gt;
--[[User:B michaelsen|B michaelsen]] 16:07, 20 October 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
: I&amp;#039;ve simplified things for the Users section, adding just a single link to the doc project page. The other links were to outdated info, or to info that isn&amp;#039;t much help to general users. --[[User:Ccornell|ccornell]] 10:31, 26 October 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== To get Sheet Number Instead of Page Number ==&lt;br /&gt;
&lt;br /&gt;
Hi.&lt;br /&gt;
&lt;br /&gt;
I am having a little problem: I need to get sheet number instead of page number;&lt;br /&gt;
&lt;br /&gt;
I made this routine:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Sub SetCurrSheet&lt;br /&gt;
    dim NumFol, NumPg, TotFol, oDoc as object, dispatcher as object, gVC&lt;br /&gt;
    oDoc = ThisComponent&lt;br /&gt;
    gVC = oDoc.CurrentController.getViewCursor()&lt;br /&gt;
           dispatcher = createUnoService(&amp;quot;com.sun.star.frame.DispatchHelper&amp;quot;)&lt;br /&gt;
    TotFol = oDoc.CurrentController.PageCount &amp;#039; Total de Páginas&lt;br /&gt;
    gVC.jumpToFirstPage rem posiciona primeira pagina  &lt;br /&gt;
    for M = 1 to TotFol&lt;br /&gt;
       sName = oDoc.getCurrentController().getViewCursor().PageStyleName&lt;br /&gt;
       oST = oDoc.StyleFamilies.getByName(&amp;quot;PageStyles&amp;quot;).getByName(sName)&lt;br /&gt;
       oST.HeaderIsOn = false&lt;br /&gt;
       oST.HeaderIsShared = false&lt;br /&gt;
       oST.HeaderIsOn = true&lt;br /&gt;
       oST.HeaderIsShared = false&lt;br /&gt;
       oText = oST.HeaderText&lt;br /&gt;
       oCur = oText.createTextCursor()&lt;br /&gt;
       NumPg = gVC.getPage()&lt;br /&gt;
       msgbox &amp;quot;Pagina atual: &amp;quot; &amp;amp; NumPg&lt;br /&gt;
       Select Case NumPg&lt;br /&gt;
       Case NumPg = 1&lt;br /&gt;
           NumFol = 1&lt;br /&gt;
       Case Else&lt;br /&gt;
           NumFol = iif(NumPg Mod 2, int(NumPg / 2 + 1),NumPg / 2)&lt;br /&gt;
       End Select&lt;br /&gt;
       MsgBox &amp;quot;Folha Passada: &amp;quot; &amp;amp; NumFol&lt;br /&gt;
 &amp;#039;      oCur.setString(&amp;quot;Folha &amp;quot; &amp;amp; NumFol)&lt;br /&gt;
       oText.setString(&amp;quot;Folha &amp;quot; &amp;amp; NumFol, False)&lt;br /&gt;
       msgbox &amp;quot;Numero de Páginas: &amp;quot; &amp;amp; TotFol &lt;br /&gt;
       gVC.jumpToNextPage()&lt;br /&gt;
   next M&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
But it returns only a static information, not a user field. I did like to utilize that routine used on our wiki, at final of page:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  /** This method inserts both a date field and a user field containing the number &amp;#039;42&amp;#039;   */  protected void TextFieldExample() {      try {          // Use the text document&amp;#039;s factory to create a DateTime text field,           // and access it&amp;#039;s          // XTextField interface          XTextField xDateField = (XTextField) UnoRuntime.queryInterface(              XTextField.class, mxDocFactory.createInstance(                  &amp;quot;com.sun.star.text.textfield.DateTime&amp;quot;));           // Insert it at the end of the document          mxDocText.insertTextContent ( mxDocText.getEnd(), xDateField, false );           // Use the text document&amp;#039;s factory to create a user text field,           // and access it&amp;#039;s XDependentTextField interface          XDependentTextField xUserField = (XDependentTextField) UnoRuntime.queryInterface (              XDependentTextField.class, mxDocFactory.createInstance(                  &amp;quot;com.sun.star.text.textfield.User&amp;quot;));           // Create a fieldmaster for our newly created User Text field, and access it&amp;#039;s           // XPropertySet interface          XPropertySet xMasterPropSet = (XPropertySet) UnoRuntime.queryInterface(              XPropertySet.class, mxDocFactory.createInstance(                  &amp;quot;com.sun.star.text.fieldmaster.User&amp;quot;));           // Set the name and value of the FieldMaster          xMasterPropSet.setPropertyValue (&amp;quot;Name&amp;quot;, &amp;quot;UserEmperor&amp;quot;);          xMasterPropSet.setPropertyValue (&amp;quot;Value&amp;quot;, new Integer(42));           // Attach the field master to the user field          xUserField.attachTextFieldMaster (xMasterPropSet);           // Move the cursor to the end of the document          mxDocCursor.gotoEnd(false);          // insert a paragraph break using the XSimpleText interface          mxDocText.insertControlCharacter(               mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false);           // Insert the user field at the end of the document          mxDocText.insertTextContent(mxDocText.getEnd(), xUserField, false);      } catch (Exception e) {          e.printStackTrace (System.out);      }  }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instead of &amp;quot;42&amp;quot;, to bring sheet # (that is: PageNumber MOD 2).&lt;br /&gt;
I do not know to codificate this. Somebody help me to achieve it, please...&lt;br /&gt;
Morvan&lt;/div&gt;</summary>
		<author><name>Morvan</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:Documentation/DevGuide/Text/Text_Fields&amp;diff=214671</id>
		<title>Talk:Documentation/DevGuide/Text/Text Fields</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:Documentation/DevGuide/Text/Text_Fields&amp;diff=214671"/>
		<updated>2013-02-04T11:31:41Z</updated>

		<summary type="html">&lt;p&gt;Morvan: To get Sheet Number Instead of Page Number&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Hi.&lt;br /&gt;
&lt;br /&gt;
I am having a little problem: I need to get sheet number instead of page number;&lt;br /&gt;
&lt;br /&gt;
I made this routine:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
Sub SetCurrSheet&lt;br /&gt;
    dim NumFol, NumPg, TotFol, oDoc as object, dispatcher as object, gVC&lt;br /&gt;
    oDoc = ThisComponent&lt;br /&gt;
    gVC = oDoc.CurrentController.getViewCursor()&lt;br /&gt;
           dispatcher = createUnoService(&amp;quot;com.sun.star.frame.DispatchHelper&amp;quot;)&lt;br /&gt;
    TotFol = oDoc.CurrentController.PageCount &amp;#039; Total de Páginas&lt;br /&gt;
    gVC.jumpToFirstPage rem posiciona primeira pagina  &lt;br /&gt;
    for M = 1 to TotFol&lt;br /&gt;
       sName = oDoc.getCurrentController().getViewCursor().PageStyleName&lt;br /&gt;
       oST = oDoc.StyleFamilies.getByName(&amp;quot;PageStyles&amp;quot;).getByName(sName)&lt;br /&gt;
       oST.HeaderIsOn = false&lt;br /&gt;
       oST.HeaderIsShared = false&lt;br /&gt;
       oST.HeaderIsOn = true&lt;br /&gt;
       oST.HeaderIsShared = false&lt;br /&gt;
       oText = oST.HeaderText&lt;br /&gt;
       oCur = oText.createTextCursor()&lt;br /&gt;
       NumPg = gVC.getPage()&lt;br /&gt;
       msgbox &amp;quot;Pagina atual: &amp;quot; &amp;amp; NumPg&lt;br /&gt;
       Select Case NumPg&lt;br /&gt;
       Case NumPg = 1&lt;br /&gt;
           NumFol = 1&lt;br /&gt;
       Case Else&lt;br /&gt;
           NumFol = iif(NumPg Mod 2, int(NumPg / 2 + 1),NumPg / 2)&lt;br /&gt;
       End Select&lt;br /&gt;
       MsgBox &amp;quot;Folha Passada: &amp;quot; &amp;amp; NumFol&lt;br /&gt;
 &amp;#039;      oCur.setString(&amp;quot;Folha &amp;quot; &amp;amp; NumFol)&lt;br /&gt;
       oText.setString(&amp;quot;Folha &amp;quot; &amp;amp; NumFol, False)&lt;br /&gt;
       msgbox &amp;quot;Numero de Páginas: &amp;quot; &amp;amp; TotFol &lt;br /&gt;
       gVC.jumpToNextPage()&lt;br /&gt;
   next M&lt;br /&gt;
End Sub&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
But i returns only a static information, not a user field. I did like to utilize that routine used on our wiki, at final of page:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
  /** This method inserts both a date field and a user field containing the number &amp;#039;42&amp;#039;   */  protected void TextFieldExample() {      try {          // Use the text document&amp;#039;s factory to create a DateTime text field,           // and access it&amp;#039;s          // XTextField interface          XTextField xDateField = (XTextField) UnoRuntime.queryInterface(              XTextField.class, mxDocFactory.createInstance(                  &amp;quot;com.sun.star.text.textfield.DateTime&amp;quot;));           // Insert it at the end of the document          mxDocText.insertTextContent ( mxDocText.getEnd(), xDateField, false );           // Use the text document&amp;#039;s factory to create a user text field,           // and access it&amp;#039;s XDependentTextField interface          XDependentTextField xUserField = (XDependentTextField) UnoRuntime.queryInterface (              XDependentTextField.class, mxDocFactory.createInstance(                  &amp;quot;com.sun.star.text.textfield.User&amp;quot;));           // Create a fieldmaster for our newly created User Text field, and access it&amp;#039;s           // XPropertySet interface          XPropertySet xMasterPropSet = (XPropertySet) UnoRuntime.queryInterface(              XPropertySet.class, mxDocFactory.createInstance(                  &amp;quot;com.sun.star.text.fieldmaster.User&amp;quot;));           // Set the name and value of the FieldMaster          xMasterPropSet.setPropertyValue (&amp;quot;Name&amp;quot;, &amp;quot;UserEmperor&amp;quot;);          xMasterPropSet.setPropertyValue (&amp;quot;Value&amp;quot;, new Integer(42));           // Attach the field master to the user field          xUserField.attachTextFieldMaster (xMasterPropSet);           // Move the cursor to the end of the document          mxDocCursor.gotoEnd(false);          // insert a paragraph break using the XSimpleText interface          mxDocText.insertControlCharacter(               mxDocCursor, ControlCharacter.PARAGRAPH_BREAK, false);           // Insert the user field at the end of the document          mxDocText.insertTextContent(mxDocText.getEnd(), xUserField, false);      } catch (Exception e) {          e.printStackTrace (System.out);      }  }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Instead of &amp;quot;42&amp;quot;, to bring sheet # (that is: PageNumber MOD 2).&lt;br /&gt;
I do not know to codificate this. Somebody help me to achieve it, please...&lt;br /&gt;
[[User:Morvan|Morvan, Linux User #433640]] ([[User talk:Morvan|talk]]) 11:31, 4 February 2013 (UTC)&lt;/div&gt;</summary>
		<author><name>Morvan</name></author>
	</entry>
</feed>