title: OpenOffice Writer, deleting text between two text fields
body: <p>Working with old program for creating reports with Open Office writer. In the program text inserts between two text fields named ''. Now I need to rewrite text between this text fields. Code is:</p>
  
  <pre><code>//Method GetTextField() geting text field by name
  XTextField xtf=GetTextField(fieldName);
  
  XTextRange rng = xtf.getAnchor().getEnd();
  
  rng.setString("");
  rng.setString(attr);
  </code></pre>
  
  <p>This code just insert more text without rewriting. How can I rewrite text? Maybe I should use TextCursor? But I can't figure out how I can set start and end position for TextCursor or TextRange.</p>
  
  <p>Also I can't rewrite this to another way of inserting text, because there are a lot of templates.</p>